release notes: tids & self-joins

Started by Robert Haasalmost 7 years ago5 messageshackers
Jump to latest
#1Robert Haas
robertmhaas@gmail.com

The release notes say:

<listitem>
<!--
Author: Tom Lane <tgl@sss.pgh.pa.us>
2018-12-30 [b5415e3c2] Support parameterized TidPaths.
Author: Tom Lane <tgl@sss.pgh.pa.us>
2018-12-30 [0a6ea4001] Add a hash opclass for type "tid".
-->

<para>
Improve optimization of self-joins (Tom Lane)
</para>
</listitem>

I don't think that's an accurate summary of those two items. It's
true that they could make self-joins more efficient, but my reading is
that it would only do so if the self-join happened to use the ctid
column. If you're writing SELECT * FROM foo a, foo b WHERE a.ctid =
b.ctid, it might very well help; but if you write SELECT * FROM foo a,
foo b WHERE a.x = b.x, it won't, not even if there is a unique index
on x. Or so I think.

So I think that this should probably be changed to say something like
"Improve optimization of self-joins on ctid columns" or "Improve
optimization of joins involving columns of type tid."

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#1)
Re: release notes: tids & self-joins

Robert Haas <robertmhaas@gmail.com> writes:

The release notes say:
<listitem>
<!--
Author: Tom Lane <tgl@sss.pgh.pa.us>
2018-12-30 [b5415e3c2] Support parameterized TidPaths.
Author: Tom Lane <tgl@sss.pgh.pa.us>
2018-12-30 [0a6ea4001] Add a hash opclass for type "tid".
-->

<para>
Improve optimization of self-joins (Tom Lane)
</para>
</listitem>

I don't think that's an accurate summary of those two items. It's
true that they could make self-joins more efficient, but my reading is
that it would only do so if the self-join happened to use the ctid
column.

Yeah. I think Bruce misread the commit messages, which commented that
joining on TID is only likely to be useful in a self-join.

So I think that this should probably be changed to say something like
"Improve optimization of self-joins on ctid columns" or "Improve
optimization of joins involving columns of type tid."

The latter seems fine to me.

regards, tom lane

#3David Rowley
dgrowleyml@gmail.com
In reply to: Tom Lane (#2)
Re: release notes: tids & self-joins

On Fri, 14 Jun 2019 at 05:22, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Robert Haas <robertmhaas@gmail.com> writes:

So I think that this should probably be changed to say something like
"Improve optimization of self-joins on ctid columns" or "Improve
optimization of joins involving columns of type tid."

The latter seems fine to me.

The latter seems a bit inaccurate to me given the fact that a column
with the type tid could exist elsewhere in the table. Perhaps
"columns of type tid" can be swapped with "a table's ctid column".

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: David Rowley (#3)
Re: release notes: tids & self-joins

David Rowley <david.rowley@2ndquadrant.com> writes:

On Fri, 14 Jun 2019 at 05:22, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Robert Haas <robertmhaas@gmail.com> writes:

So I think that this should probably be changed to say something like
"Improve optimization of self-joins on ctid columns" or "Improve
optimization of joins involving columns of type tid."

The latter seems fine to me.

The latter seems a bit inaccurate to me given the fact that a column
with the type tid could exist elsewhere in the table. Perhaps
"columns of type tid" can be swapped with "a table's ctid column".

It's true that the parameterized-tidscan patch only helps for joins
to CTID, but the other patch helps for joins to any tid column.
So I still say Robert's wording is fine.

regards, tom lane

#5Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#2)
Re: release notes: tids & self-joins

On Thu, Jun 13, 2019 at 01:22:16PM -0400, Tom Lane wrote:

Robert Haas <robertmhaas@gmail.com> writes:

The release notes say:
<listitem>
<!--
Author: Tom Lane <tgl@sss.pgh.pa.us>
2018-12-30 [b5415e3c2] Support parameterized TidPaths.
Author: Tom Lane <tgl@sss.pgh.pa.us>
2018-12-30 [0a6ea4001] Add a hash opclass for type "tid".
-->

<para>
Improve optimization of self-joins (Tom Lane)
</para>
</listitem>

I don't think that's an accurate summary of those two items. It's
true that they could make self-joins more efficient, but my reading is
that it would only do so if the self-join happened to use the ctid
column.

Yeah. I think Bruce misread the commit messages, which commented that
joining on TID is only likely to be useful in a self-join.

So I think that this should probably be changed to say something like
"Improve optimization of self-joins on ctid columns" or "Improve
optimization of joins involving columns of type tid."

The latter seems fine to me.

I have updated to use the later wording.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +