Joining between large & small tables?

Поиск
Список
Период
Сортировка
Искать

Joining between large & small tables?

От:
Wells Oliver <wells.oliver@gmail.com>
Дата:
Given a large large large table A and a small small temp table B is there any benefit to doing SELECT * FROM a JOIN b USING (somecol) vs SELECT * FROM b JOIN a USING (somecol)?

When you just want the intersection...

--

Re: Joining between large & small tables?

От:
Scott Ribe <scott_ribe@elevated-dev.com>
Дата:
> On Jul 13, 2020, at 7:39 PM, Wells Oliver  wrote:
> 
> Given a large large large table A and a small small temp table B is there any benefit to doing SELECT * FROM a JOIN b USING (somecol) vs SELECT * FROM b JOIN a USING (somecol)?
> 
> When you just want the intersection...

No, planner will figure out how to join based on stats, not order. (With default planner options; there are ways to work around that in the rare case that the planner can't figure out the best way.)

Re: Joining between large & small tables?

От:
"David G. Johnston" <david.g.johnston@gmail.com>
Дата:
On Mon, Jul 13, 2020 at 6:40 PM Wells Oliver <wells.oliver@gmail.com> wrote:
Given a large large large table A and a small small temp table B is there any benefit to doing SELECT * FROM a JOIN b USING (somecol) vs SELECT * FROM b JOIN a USING (somecol)?


David J.
FAQ