|
1 | 1 | <sect1 id="plantuner">
|
2 | 2 | <title>plantuner</title>
|
3 | 3 | <para>
|
4 |
| - The <literal>plantuner</literal> module provides hits for planner, |
5 |
| - which can disable or enable indexes for query execution. |
| 4 | + The <filename>plantuner</filename> module provides hints |
| 5 | + for the planner that can disable or enable indexes for query execution. |
6 | 6 | </para>
|
7 | 7 |
|
8 | 8 | <sect2 id="plantuner-motivation">
|
9 | 9 | <title>Motivation</title>
|
10 | 10 | <para>
|
11 |
| - Whether somebody think it's bad or not, but sometime it's very |
12 |
| - interesting to be able to control planner (provide hints, which tell |
13 |
| - optimizer to ignore its algorithm in part), which is currently |
14 |
| - impossible in &productname; (and PostgreSQL). |
15 |
| - Oracle, for example, has over 120 hints, |
16 |
| - and Microsoft SQL Server also supports hints. |
| 11 | + In some cases, it may be required to control the planner |
| 12 | + by providing hints that make the optimizer ignore some |
| 13 | + parts of its algorithm. There are many situations when |
| 14 | + a developer may want to temporarily disable specific |
| 15 | + index(es), without dropping them, or to instruct the planner to |
| 16 | + use a specific index. |
17 | 17 | </para>
|
18 | 18 | <para>
|
19 |
| - This first version of plantuner provides a possibility to hide |
20 |
| - specified indexes from &productname; planner, so it will not use them. |
21 |
| - </para> |
22 |
| - <para> |
23 |
| - There are many situations when developer want to temporarily disable |
24 |
| - specific index(es), without dropping them, or to instruct planner to |
25 |
| - use specific index. |
26 |
| - </para> |
27 |
| - <para> |
28 |
| - Next, for some workload &productname; could be too pessimistic for |
29 |
| - newly created tables and assumes much more rows in table than |
30 |
| - it actually has. If plantuner.fix_empty_table GUC variable is set |
31 |
| - to true then module will set to zero the number of pages/tuples of |
32 |
| - table which hasn't blocks in a file. |
| 19 | + This version of <filename>plantuner</filename> provides a |
| 20 | + possibility to hide the specified indexes from &productname; |
| 21 | + planner, so it will not use them.For some workloads, &productname; |
| 22 | + could be too pessimistic about newly created tables and assume |
| 23 | + that there are much more rows in a table than it actually has. If the |
| 24 | + <varname>plantuner.fix_empty_table</varname> GUC variable is set |
| 25 | + to <literal>true</literal>, <filename>plantuner</filename> sets to zero |
| 26 | + the number of pages/tuples of the table that has no blocks in a file. |
33 | 27 | </para>
|
34 | 28 | </sect2>
|
35 | 29 |
|
36 |
| - <sect2 id="plantuner-syntax"> |
37 |
| - <title>Syntax</title> |
38 |
| - <para>plantuner.disable_index — List of indexes invisible to planner</para> |
39 |
| - <para>plantuner.enable_index — List of indexes visible to planner even they are hidden by plantuner.disable_index.</para> |
| 30 | + <sect2 id="plantuner-guc-variables"> |
| 31 | + <title>GUC Variables</title> |
| 32 | + <para><varname>plantuner.disable_index</varname> — list of indexes invisible to planner.</para> |
| 33 | + <para><varname>plantuner.enable_index</varname> — list of indexes visible to planner even if they are hidden by <varname>plantuner.disable_index</varname>.</para> |
40 | 34 | </sect2>
|
41 | 35 |
|
42 | 36 | <sect2 id="plantuner-usage-example">
|
43 | 37 | <title>Example</title>
|
44 | 38 | <para>
|
45 |
| - To enable the module you can either load shared library 'plantuner' in |
46 |
| - psql session or specify 'shared_preload_libraries' option in |
47 |
| - postgresql.conf. |
| 39 | + To enable the module, you can either load <literal>plantuner</literal> |
| 40 | + shared library in a <literal>psql</literal> session or specify |
| 41 | + <varname>shared_preload_libraries</varname> option in |
| 42 | + <filename>postgresql.conf</filename>. |
48 | 43 | <programlisting>
|
49 | 44 | =# LOAD 'plantuner';
|
50 | 45 | =# create table test(id int);
|
|
0 commit comments