Re: Rangejoin rebased

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Rangejoin rebased
Date: 2018-01-10 04:24:48
Message-ID: CAMp0ubdJ+P5GaGtTsLygx+BUmm7dHit=8L=mASuP83-CjCVeOQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jan 6, 2018 at 10:38 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> For this to be useful, it needs to include some details of how to use
> it when people have NOT used range datatypes in their tables.

Good idea. I added an example that doesn't have range types in the base table.

> If we can see some examples with StartDate and EndDate cast to a
> tzrange, plus some "don't write it like this" anti-patterns that would
> help.

By "anti-patterns", I assume you mean implementing range intersection
by hand in SQL over non-range types. Such an example would be quite a
long query, and might add to the confusion -- it seems strange to
spend more text explaining what *not* to do than what to do.

I see what you are saying, but perhaps I'm just not coming up with the
right text to explain it succinctly in the manual, so for now I just
added one example. Let me know if you think it needs more.

> We can then make it clear that this is a huge performance benefit for
> these important cases.

Done.

> Just to emphasise why we want this, it might be better for the EXPLAIN
> to say "Time Range Join" when the ranges being joined are Time Ranges,
> and for other cases to just say "Range Join". The use of the word
> Merge doesn't help much there.

I don't care for special-casing the word "time" in there, because no
other type would benefit. It seems a little too magical. I also do
like leaving "merge" in there because it helps the user understand why
their inputs are being sorted.

Regards,
Jeff Davis

Attachment Content-Type Size
rangejoin20180109.diff text/plain 55.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Haribabu Kommi 2018-01-10 05:10:35 Re: Enhance pg_stat_wal_receiver view to display connected host
Previous Message David Rowley 2018-01-10 04:18:58 Re: [HACKERS] path toward faster partition pruning