Re: [HACKERS] DISTINCT with btree skip scan

2016-11-24 Thread Robert Haas
On Wed, Nov 23, 2016 at 4:19 PM, Thomas Munro wrote: > On Wed, Oct 12, 2016 at 4:19 PM, Thomas Munro > wrote: >> Here it is, now split into two parts: one patch >> to add an amskip operation, and another to consider using it to >>

Re: [HACKERS] DISTINCT with btree skip scan

2016-11-24 Thread Geoff Winkless
On 23 November 2016 at 21:19, Thomas Munro wrote: > Worth pursuing? Does amskip suck? Does anyone have better ideas, > either for how to do the low level skip or the higher level Index Skip > Scan, or perhaps a completely different way of looking at this? I have

Re: [HACKERS] DISTINCT with btree skip scan

2016-11-23 Thread Thomas Munro
On Wed, Oct 12, 2016 at 4:19 PM, Thomas Munro wrote: > Here it is, now split into two parts: one patch > to add an amskip operation, and another to consider using it to > implement DISTINCT when it was already has an index only scan path on > an index that supports

Re: [HACKERS] DISTINCT with btree skip scan

2016-10-11 Thread Thomas Munro
On Sat, Nov 1, 2014 at 10:35 AM, Thomas Munro wrote: > I am definitely interested in collaborating on a series of patches to > implement various kinds of skip-based plans as seen in other RDBMSs if > others think it could be useful. I see skip-based DISTINCT as a good > place to

Re: [HACKERS] DISTINCT with btree skip scan

2014-10-31 Thread Thomas Munro
On 27 October 2014 20:24, David Rowley dgrowle...@gmail.com wrote: I've had a quick look at this and it seems like a great win! I'm quite surprised that we've not got this already. I think this technology could also really help performance of queries such as SELECT * from bigtable bt WHERE

Re: [HACKERS] DISTINCT with btree skip scan

2014-10-27 Thread David Rowley
On Sat, Jul 5, 2014 at 12:17 PM, Thomas Munro mu...@ip9.org wrote: postgres=# set enable_hashagg = false; SET Time: 0.302 ms postgres=# explain select distinct a from foo; ┌─┐ │

Re: [HACKERS] DISTINCT with btree skip scan

2014-07-05 Thread Thomas Munro
On 5 July 2014 02:03, Vik Fearing vik.fear...@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

[HACKERS] DISTINCT with btree skip scan

2014-07-04 Thread Thomas Munro
Hello As an exercise I hacked up the simplest code I could think of that would demonstrate a faster DISTINCT based on skipping ahead to the next distinct value in an index-only scan. Please see the attached (extremely buggy) patch, and the example session below. (It's against my natural instinct

Re: [HACKERS] DISTINCT with btree skip scan

2014-07-04 Thread Vik Fearing
On 07/05/2014 02:17 AM, Thomas Munro wrote: As an exercise I hacked up the simplest code I could think of that would demonstrate a faster DISTINCT based on skipping ahead to the next distinct value in an index-only scan. Please see the attached (extremely buggy) patch, and the example session