Re: Poor performance when joining against inherited tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Lucas Madar <madar(at)samsix(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Poor performance when joining against inherited tables
Date: 2011-05-11 17:00:26
Message-ID: 508.1305133226@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> A more interesting question is why you're not getting a plan like this:

> Nested Loop
> -> Seq Scan on objects
> -> Append
> -> Index Scan using xxx_pkey on itemXX
> -> Index Scan using yyy_pkey on itemYY
> -> Index Scan using zzz_pkey on itemZZ

Probably because there are 4 million rows in the objects table.

Or maybe it's a pre-8.2 database and can't even generate such a plan.
But if it did generate it, it would almost certainly have decided that
this was more expensive than a hash or merge join.

People have this weird idea that the existence of an index ought to make
enormous joins free ...

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Pierre C 2011-05-11 18:10:54 Re: Postgres refusing to use >1 core
Previous Message Robert Haas 2011-05-11 16:38:44 Re: Poor performance when joining against inherited tables