Patch to Remove INNER JOINs

Поиск
Список
Период
Сортировка
От David Rowley
Тема Patch to Remove INNER JOINs
Дата
Msg-id CAApHDvp4SsyQq5r+j5iUA1rF1SuWGD5QrhoVLqOqOxVXe=Njxw@mail.gmail.com
обсуждение исходный текст
Список pgsql-hackers
Over here -> http://www.postgresql.org/message-id/CAApHDvqd99i2eeSY6PhUeo8CmKkuDHenzSA-eDAmswSzhU2_Dw@mail.gmail.com I posted a patch to add support for removing SEMI and ANTI joins, where the join could be proved useless by the existence of a foreign key. 

The patch was part of my incremental work with the end goal of allowing INNER JOIN removal using similar logic. Though it seems that nobody was interested the extra code for such a small use case as semi/anti join removal. 

Over here ->  http://www.postgresql.org/message-id/2261.1409163818@sss.pgh.pa.us Tom said he'd rather see the INNER JOIN removal stuff working before getting all the required infrastructure into the code base... (or at least that's how I understood it) I then went off and started working on the INNER JOIN removal stuff and posted it here -> http://www.postgresql.org/message-id/CAApHDvpDXXvKE+=ug1kA--nKfa=bjrjvK8Gp9G8UYwv6nHckVg@mail.gmail.com , so there's now little point in going on with discussions on the thread that was meant for semi/anti join removals. Hence why I'm starting a new one to talk about the INNER JOIN removal patch. I'm hoping this subject will generate enough interest for a review at some point.

I've attached a patch that I've done a bit more work on based on a few comments gathered from the semi/anti join thread.

For anyone that's not clicked the links above.. Here's a demo of what the patch does.

test=# create table c (id int primary key);
CREATE TABLE
test=# create table b (id int primary key, c_id int not null references
c(id));
CREATE TABLE
test=# create table a (id int primary key, b_id int not null references
b(id));
CREATE TABLE
test=#
test=# explain select a.* from a inner join b on a.b_id = b.id inner join c on b.c_id = c.id;
                     QUERY PLAN
-----------------------------------------------------
 Seq Scan on a  (cost=0.00..31.40 rows=2140 width=8)
 Planning time: 1.061 ms

Regards

David Rowley
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Emre Hasegeli
Дата:
Сообщение: Re: KNN-GiST with recheck
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: KNN-GiST with recheck