Re: DISTINCT with btree skip scan - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: DISTINCT with btree skip scan
Date
Msg-id CADLWmXViay1au8duZOBzmfc_ZOOjXtNeGz1TGSUjX53oA2ehVA@mail.gmail.com
Whole thread Raw
In response to Re: DISTINCT with btree skip scan  (Vik Fearing <vik.fearing@dalibo.com>)
List pgsql-hackers
On 5 July 2014 02:03, Vik Fearing <vik.fearing@dalibo.com> wrote:
> [1] http://wiki.postgresql.org/wiki/Loose_indexscan

Thanks. It talks about DISTINCT, and also about using index when you
don't have the leading column in your WHERE clause (as well as MySQL
("loose"), at least Oracle ("skip"), SQLite ("skip"), DB2 ("jump") can
do this).  It looks like at least MySQL can also use loose index scans
to implement GROUP BY in certain cases involving MIN or MAX aggregate
functions (things like SELECT a, MIN(b) FROM foo GROUP BY a, given an
index on (a, b)).

But I'm only trying to implement the lowest hanging index skipping
plan: plain old DISTINCT.  I think I see roughly how to cost, plan and
execute it...  now to learn a lot more about PG internals...



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Allowing join removals for more join types
Next
From: Stephen Frost
Date:
Subject: Re: tweaking NTUP_PER_BUCKET