You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
If you often run queries of the same type, for example,you application limits the number
124
+
If you often run queries of the same type, for example,your application limits the number
125
125
of possible query types, you can use the <literal>intelligent</literal> mode to
126
126
improve planning for these queries. In this mode, <filename>aqo</filename>
127
127
analyzes each query execution and stores statistics. Statistics on queries of
@@ -170,7 +170,7 @@ SET aqo.mode = 'controlled';
170
170
When run in the <literal>intelligent</literal> mode, <filename>aqo</filename> assigns a unique hash value
171
171
to each query type to separate the collected statistics. If you
172
172
switch to the <literal>forced</literal> mode, the statistics for all untracked query
173
-
types is stored in common query type with hash 0. You can view all
173
+
types is stored inacommon query type with hash 0. You can view all
174
174
the processed query types and their corresponding hash values in
175
175
the <structname>aqo_query_texts</structname> table:
176
176
</para>
@@ -231,7 +231,7 @@ SELECT * FROM aqo_queries;
231
231
232
232
SET aqo.mode='intelligent';
233
233
SELECT * FROM a, b WHERE a.id=b.id;
234
-
SET aqo.mode='manual';
234
+
SET aqo.mode='controlled';
235
235
236
236
-- Disable auto_tuning, enable both learn_aqo and use_aqo
237
237
-- for this query type:
@@ -263,7 +263,7 @@ DELETE FROM aqo_data;
263
263
</programlisting>
264
264
<para>
265
265
Alternatively, you can specify a particular query type to reset by
266
-
providing its hash value in the <literal>fspase_hash</literal> option. For example:
266
+
providing its hash value in the <literal>fspace_hash</literal> option. For example:
267
267
</para>
268
268
<programlisting>
269
269
DELETE FROM aqo_data WHERE fspace_hash = (SELECT fspace_hash FROM aqo_queries
@@ -325,7 +325,7 @@ UPDATE aqo_queries SET use_aqo=false, learn_aqo=false, auto_tuning=false;
325
325
<entry>Optimizes all queries together, regardless of the query type.</entry>
326
326
</row>
327
327
<row>
328
-
<entry><literal>manual</literal></entry>
328
+
<entry><literal>controlled</literal></entry>
329
329
<entry><emphasis role="strong">Default.</emphasis> Uses the default planner for all new queries, but can reuse the collected statistics for already known query types, if any.</entry>
330
330
</row>
331
331
<row>
@@ -424,7 +424,7 @@ UPDATE aqo_queries SET use_aqo=false, learn_aqo=false, auto_tuning=false;
424
424
intelligent mode. In other modes, new queries are not
425
425
appended to <structname>aqo_queries</structname> automatically.
Copy file name to clipboardExpand all lines: doc/src/sgml/atx.sgml
+42-42Lines changed: 42 additions & 42 deletions
Original file line number
Diff line number
Diff line change
@@ -1,102 +1,102 @@
1
1
<!-- doc/src/sgml/atx.sgml -->
2
2
3
3
<chapter id="atx">
4
-
<title>Autonomoustransactions</title>
4
+
<title>AutonomousTransactions</title>
5
5
6
6
<sect1 id="atx-overview">
7
-
<title>Overview of autonomous transactions</title>
7
+
<title>Overview</title>
8
8
9
9
<para>
10
10
&productname; supports nested transactions: they are rarely explicitly used by programmer and mostly used for error handling and stored
11
-
procedures. It is possible to rollback subtransaction without affecting parent transaction. But commit of subtraction is delayed until
11
+
procedures. It is possible to rollbackasubtransaction without affectingtheparent transaction. But commit of a subtraction is delayed until
12
12
commit of parent transaction.
13
13
</para>
14
14
<para>
15
-
But in some cases application needs to run several independent transactions in one session.
16
-
<quote>Autonomous Subtransactions</quote> (in short <acronym>AST</acronym>) denotes the capability of a single session
17
-
to run multiple independent transactions, as if multiple different sessions were executing each transaction.
18
-
</para>
19
-
<para>
20
-
Autonomous transactions are needed mostly for implementing audits, when the fact of performing audit should be reported regardless
21
-
status of audit itself: whether it was successfully completed or not.
22
-
Autonomous transactions are widely used in Oracle PL-SQL, so porting such procedures to &productname; is problematic without autonomous transaction support.
15
+
However, in some cases applications need to run several independent transactions inside a single transaction — <quote>autonomous transactions</quote>. Autonomous transactions are needed mostly for implementing audits, when the fact of performing an audit should be reported regardless of the
16
+
status of the audit itself: whether it was successfully completed or not.
23
17
</para>
24
18
25
19
</sect1>
26
20
27
21
<sect1><title>Behavior</title>
28
22
<para>
29
-
An<acronym>AST</acronym> can happen only inside another transaction.
30
-
Inside an existing transaction (call it T0), the user can decide to starta subtransaction. Then T0 is paused and pushed in an<acronym>AST</acronym> stack, and a new transaction (call it T1) is started.
23
+
Anautonomous transaction can happen only inside another transaction.
24
+
Inside an existing transaction (call it T0), the user can decide to startan autonomous transaction. Then T0 is paused and pushed in anautonomous transaction stack, and a new transaction (call it T1) is started.
31
25
</para>
32
26
<para>
33
-
At some point in the future the user can commit thesubtransaction; after T1 is committed then T0 is popped from the<acronym>AST</acronym> stack and resumed.
34
-
The user can also decide to <command>COMMIT</command> the parent transaction T0, in which case T1 is committed, then T0 is popped from the<acronym>AST</acronym> stack and then committed.
27
+
At some point in the future the user can commit theautonomous transaction; after T1 is committed then T0 is popped from theautonomous transaction stack and resumed.
28
+
The user can also decide to <command>COMMIT</command> the parent transaction T0, in which case T1 is committed, then T0 is popped from theautonomous transaction stack and then committed.
35
29
</para>
36
30
<para>
37
31
All the transactions happen synchronously; at any time only one transaction can be active, while in the stack there are zero (or more) paused transactions in the stack.
38
32
All the possible combinations of <command>COMMIT</command> / <command>ROLLBACK</command> for T0 and T1 can happen;
39
33
for instance, it is possible to COMMIT T1 and ROLLBACK T0.
40
-
It is possible to nestsubtransactions, up to a global resource limit (e.g. the<acronym>AST</acronym> stack size) which can be set on the server.
34
+
It is possible to nestautonomous transactions, up to a global resource limit (e.g. theautonomous transaction stack size) which can be set on the server.
41
35
</para>
42
36
43
37
</sect1>
44
38
45
-
<sect1><title>Example</title>
39
+
<sect1><title>Examples</title>
46
40
47
41
<para>
48
-
The following figure describes anexample where atransactionexecutes a subtransaction. A continuous line denotes an active transaction, while a dotted line denotes a transaction which has been paused and pushed in the<acronym>AST</acronym> stack. Time flows downwards.
42
+
This example illustrates how anautonomoustransactionis executed. A continuous line denotes an active transaction, while a dotted line denotes a transaction which has been paused and pushed in theautonomous transaction stack. Time flows downwards.
49
43
</para>
50
44
51
45
<programlisting>
52
-
BEGIN; --start ordinarytx T0
46
+
BEGIN; --starts ordinarytransaction T0
53
47
|
54
48
INSERT INTO t VALUES (1);
55
49
:\
56
-
: BEGIN AUTONOMOUS TRANSACTION; -- start AST tx T1, pushes T0 into stack
50
+
: BEGIN AUTONOMOUS TRANSACTION; -- starts autonomous transaction
Visibility rules work as in the case of independent transactions executed via <literal>dblink</literal>.
108
108
T1 does not see the effects of T0, because the latter has not been committed yet. T0 might see the effects of T1, depending on its own transaction isolation mode.
109
-
In case of Read Committed isolation level the parent transaction will see changes made by autonomoussubtransaction.
110
-
But in case of Repeatable Read isolation level the parent transaction will not see changes made by autonomoussubtransaction.
109
+
In case of Read Committed isolation level the parent transaction will see changes made by autonomoustransactions.
110
+
But in case of Repeatable Read isolation level the parent transaction will not see changes made by autonomoustransactions.
111
111
</para>
112
112
113
113
<para>
114
-
Now single-session deadlocks become possible, because an<acronym>AST</acronym>can become entangled with one of the paused transactions init's session.
114
+
Now single-session deadlocks become possible, because anautonomous transactioncan become entangled with one of the paused transactions inits session.
115
115
Autonomous transaction T1 is assumed to depend on parent transaction T0 and if it attempts to obtain any resource locked by T0, then