|From:||Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>|
|To:||Dmitry Dolgov <9erthalion6(at)gmail(dot)com>|
|Cc:||David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com>, Floris Van Nee <florisvannee(at)optiver(dot)com>, Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Alexander Kuzmenkov <a(dot)kuzmenkov(at)postgrespro(dot)ru>, Peter Geoghegan <pg(at)bowt(dot)ie>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Bhushan Uparkar <bhushan(dot)uparkar(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, James Coleman <jtc331(at)gmail(dot)com>|
|Subject:||Re: Index Skip Scan|
|Views:||Raw Message | Whole Thread | Download mbox | Resend email|
I've done some initial review on v20 - just reading through the code, no
tests at this point. Here are my comments:
I'm not sure why the enable_indexskipscan section says
This parameter requires that <varname>enable_indexonlyscan</varname>
I suppose it's the same thing as for enable_indexscan, and we don't say
anything like that for that GUC.
The new section is somewhat unclear and difficult to understand, I think
it'd deserve a rewording. Also, I wonder if we really should link to the
wiki page about FSM problems. We have a couple of wiki links in the sgml
docs, but those seem more generic while this seems as a development page
that might disapper. But more importantly, that wiki page does not say
anything about "Loose Index scans" so is it even the right wiki page?
_bt_skip - comments are formatted incorrectly
_bt_update_skip_scankeys - missing comment
_bt_scankey_within_page - missing comment
There are duplicate blocks of code for IndexScan and IndexOnlyScan:
if (indexscan->skipPrefixSize > 0)
if (es->format != EXPLAIN_FORMAT_TEXT)
ExplainPropertyInteger("Distinct Prefix", NULL,
I suggest we wrap this into a function ExplainIndexSkipScanKeys() or
something like that.
Also, there's this:
if (((IndexScan *) plan)->skipPrefixSize > 0)
ExplainPropertyText("Scan mode", "Skip scan", es);
That does not make much sense - there's just a single 'scan mode' value.
So I suggest we do the same thing as for unique joins, i.e.
(((IndexScan *) plan)->skipPrefixSize > 0),
In ExecInitIndexOnlyScan, we should initialize the ioss_ fields a bit
later, with the existing ones. This is just cosmetic issue, though.
I wonder why we even add and initialize the ioss_ fields for IndexScan
nodes, when the skip scans require index-only scans?
I wonder how much was the costing discussed. It seems to me the logic is
fairly similar to ideas discussed in the incremental sort patch, and
we've been discussing some weak points there. I'm not sure how much we
need to consider those issues here.
The comment before IndexScanState mentions new field NumDistinctKeys,
but there's no such field added to the struct.
I don't understand what the uniq_distinct_pathkeys comment says :-(
The naming of the new field (skipPrefixSize) added to IndexScan and
IndexOnlyScan is clearly inconsistent with the naming convention of the
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
|Next Message||Michael Paquier||2019-06-23 13:25:35||Refactoring base64 encoding and decoding into a safer interface|
|Previous Message||Vik Fearing||2019-06-23 11:43:20||Re: Code comment change|