Re: [HACKERS] Improving DISTINCT with LooseScan node

2017-09-18 Thread Dmitriy Sarafannikov
> It seems related to this thread? : > https://www.postgresql.org/message-id/flat/5037A9C5.4030701%40optionshouse.com#5037a9c5.4030...@optionshouse.com > > And this wiki page : https://wiki.postgresql.org/wiki/Loose_indexscan Yep. Now i can see 2 use cases for this feature: 1. DISTINCT queries.

Re: [HACKERS] Improving DISTINCT with LooseScan node

2017-09-18 Thread Adrien Nayrat
On 09/17/2017 07:43 PM, Dmitriy Sarafannikov wrote: [...] It seems related to this thread? : https://www.postgresql.org/message-id/flat/5037A9C5.4030701%40optionshouse.com#5037a9c5.4030...@optionshouse.com And this wiki page : https://wiki.postgresql.org/wiki/Loose_indexscan Regards, --

Re: [HACKERS] Improving DISTINCT with LooseScan node

2017-09-17 Thread Thomas Munro
On Mon, Sep 18, 2017 at 5:43 AM, Dmitriy Sarafannikov wrote: > Hi hackers, > > Everybody knows, that we have unefficient execution of query like "SELECT > DISTINCT id from mytable" > if table has many-many rows and only several unique id values. Query plan > looks like

[HACKERS] Improving DISTINCT with LooseScan node

2017-09-17 Thread Dmitriy Sarafannikov
Hi hackers, Everybody knows, that we have unefficient execution of query like "SELECT DISTINCT id from mytable"if table has many-many rows and only several unique id values. Query plan looks like Unique + IndexScan. I have tried to implement this feature in new type of node called Loose Scan.This