Re: TB-sized databases - Mailing list pgsql-performance

From Ron Mayer
Subject Re: TB-sized databases
Date
Msg-id 4758D60C.50703@cheapcomplexdevices.com
Whole thread Raw
In response to Re: TB-sized databases  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
Tom Lane wrote:
> Ron Mayer <rm_pg@cheapcomplexdevices.com> writes:
>> Tom Lane wrote:
>>> ...given that that plan has a lower cost estimate, it
>>> should've picked it without any artificialconstraints.
>
>>I think the reason it's not picking it was discussed back...
>> http://archives.postgresql.org/pgsql-performance/2005-03/msg00675.php
> ...
>
> The concern I mentioned in the above thread was basically that I don't
> want the planner to go off chasing Cartesian join paths in general...
> However, in this case the reason that the Cartesian join might be
> relevant is that both of them are needed in order to form an inner
> indexscan on the big table....

Interesting....  I think Simon mentioned last time that this type of
query is quite common for standard star schema data warehouses.
And it seem to me the Cartesian join on the dimension tables is
often pretty harmless since each dimension table would often return
just 1 row; and the size of the fact table is such that it's useful
to touch it as little as possible.

> Way too late for 8.3, but something to think about for next time.

No problem.. we've been working around it since that last
thread in early '05 with early 8.0, IIRC.  :-)

Thanks to the excellent postgres hints system ("offset 0" and
"set join_collapse_limit=1") we can get the plans we want
pretty easily. :-)

pgsql-performance by date:

Previous
From: Ron Mayer
Date:
Subject: Re: TB-sized databases
Next
From: Richard Huxton
Date:
Subject: Re: database tuning