X-Git-Url: http://sigaev.ru/git/gitweb.cgi?p=plantuner.git;a=blobdiff_plain;f=README.plantuner;h=17c8ba010b85d9099fc019f3886d6c6a157f16d1;hp=2d01f8e28d8f3026c31cef0d464a0d369a3b0f8f;hb=HEAD;hpb=0cbb8205225d8f69ff3604b7d067fa96ce6b0c03 diff --git a/README.plantuner b/README.plantuner index 2d01f8e..17c8ba0 100644 --- a/README.plantuner +++ b/README.plantuner @@ -23,11 +23,28 @@ Motivation specific index(es), without dropping them, or to instruct planner to use specific index. + Next, for some workload PostgreSQL could be too pessimistic for + newly created tables and assumes much more rows in table than + it actually has. If plantuner.fix_empty_table GUC variable is set + to true then module will set to zero number of pages/tuples of + table which hasn't blocks in file. + Installation * Get latest source of plantuner from CVS Repository * gmake && gmake install && gmake installcheck +Syntax + plantuner.forbid_index (deprecated) + plantuner.disable_index + List of indexes invisible to planner + plantuner.enable_index + List of indexes visible to planner even they are hided + by plantuner.disable_index. + plantuner.only_index + List of explicitly enabled indexes (overload plantuner.disable_index + and plantuner.enable_index), so, only indexes in this list are allowed. + Usage To enable the module you can either load shared library 'plantuner' in @@ -54,7 +71,7 @@ Indexes: Index Cond: (id = 1) (4 rows) =# set enable_seqscan=off; -=# set plantuner.forbid_index='id_idx2'; +=# set plantuner.disable_index='id_idx2'; =# explain select id from test where id=1; QUERY PLAN ---------------------------------------------------------------------- @@ -63,10 +80,20 @@ Indexes: -> Bitmap Index Scan on id_idx (cost=0.00..4.34 rows=12 width=0) Index Cond: (id = 1) (4 rows) -=# set plantuner.forbid_index='id_idx2,id_idx'; +=# set plantuner.disable_index='id_idx2,id_idx'; =# explain select id from test where id=1; QUERY PLAN ------------------------------------------------------------------------- Seq Scan on test (cost=10000000000.00..10000000040.00 rows=12 width=4) Filter: (id = 1) (2 rows) +=# set plantuner.enable_index='id_idx'; +=# explain select id from test where id=1; + QUERY PLAN +----------------------------------------------------------------------- + Bitmap Heap Scan on test (cost=4.34..15.03 rows=12 width=4) + Recheck Cond: (id = 1) + -> Bitmap Index Scan on id_idx (cost=0.00..4.34 rows=12 width=0) + Index Cond: (id = 1) +(4 rows) +