From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: allowing extensions to control planner behavior |
Date: | 2024-08-28 17:06:35 |
Message-ID: | CA+TgmobHUpLaSFLB3uyjNmzEzSdjf3SZwp5+JZFHHMFyLzZmPQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, Aug 28, 2024 at 8:37 AM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> This has a big advantage over what I proposed yesterday in that it's
> basically declarative. With one call to the hook, you get all the
> information about the join order that you could ever want. That's
> really nice.
Hmm. On further thought, I suppose that another disadvantage of this
kind of declarative approach is that there are some kinds of
constraints that you could conceivably want that you just can't
declare, especially negative constraints. For example, imagine we're
joining tables A1 ... A10 and we don't want A1 to be joined directly
to A2. Or suppose you want to insist on a non-bushy plan. I don't
think there's a way to express those types of requirements by frobbing
the joinlist.
I'm not quite sure whether those kinds of gaps are sufficiently
serious that we should worry about them. After all, there's a lot of
things that you can express perfectly clearly with this kind of
scheme. I don't think I know of something that you can do to control
the join order in an existing hinting system that cannot be expressed
as a manipulation of the joinlist. That's not to say that I am 100%
confident that everything everyone could reasonably want to do can be
expressed this way; in fact, I don't think that's true at all. But I
_think_ that all of the things that I know about that people are
actually doing _could_ be expressed this way, but for the
join-direction and hard-failulre problems I mentioned in my earlier
reply.
--
Robert Haas
EDB: http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Geoghegan | 2024-08-28 17:20:28 | Re: allowing extensions to control planner behavior |
Previous Message | Sushrut Shivaswamy | 2024-08-28 16:57:58 | Re: Reading all tuples in Index Access Method |