Re: Proposal for Merge Join for Non '=' Operators - Mailing list pgsql-hackers

From Hadi Moshayedi
Subject Re: Proposal for Merge Join for Non '=' Operators
Date
Msg-id CAK=1=Wod_=tNGWSrZwbgvOYZLDK3ZWxG9nqmSQQz-y8470zY7w@mail.gmail.com
Whole thread Raw
In response to Re: Proposal for Merge Join for Non '=' Operators  (Dilip kumar <dilip.kumar@huawei.com>)
Responses Re: Proposal for Merge Join for Non '=' Operators  (Dilip kumar <dilip.kumar@huawei.com>)
List pgsql-hackers
Hello Dilip,

        Query: select count(*) from t1,t2 where t1.b<t2.b and t1.b > 12000;

        Test Result:
                Nest Loop Join with Index Scan   : 1653.506 ms
                Sort Merge Join for (seq scan)   : 610.257ms


This looks like a great improvement. Repeating Nicolas's question, do you have a real-world example of such joins?

In my experience, I see more queries like "self-join table A and table B where A.time BETWEEN B.time - '1 week' and B.time", similar to what Nicolas and Tom mentioned. As an example, "count users who placed an order in the week following their registration".

Can you send a patch so we can also try it?

Thanks,
  -- Hadi

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: includedir_internal headers are not self-contained
Next
From: Ashutosh Bapat
Date:
Subject: using array of char pointers gives wrong results