Re: Mini improvement: statement_cost_limit - Mailing list pgsql-hackers

From Ron Mayer
Subject Re: Mini improvement: statement_cost_limit
Date
Msg-id 48A5A4FB.4070907@cheapcomplexdevices.com
Whole thread Raw
In response to Re: Mini improvement: statement_cost_limit  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Mini improvement: statement_cost_limit  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Bruce Momjian wrote:
> Josh Berkus wrote:
>> ...simple web applications, where 
>> queries are never supposed to take more than 50ms.  If a query turns up 
>> with an estimated cost of 10000000000, then you know something's wrong; 
>> ...
> 
> How about a simpler approach that throws an error or warning for
> cartesian products?  That seems fool-proof.

Seems less fool-proof to me.

Sometimes cartesian products produce plans that run 200 times
faster than plans that don't use the cartesian product.

The first link below shows a cartesian join that took 1.1
seconds (within the range of OK for some web apps), while
plans for the same query that don't use one took 200 seconds.

http://archives.postgresql.org/pgsql-performance/2008-03/msg00391.php
http://archives.postgresql.org/pgsql-performance/2007-12/msg00090.php
http://archives.postgresql.org/pgsql-performance/2008-03/msg00361.php



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Mini improvement: statement_cost_limit
Next
From: Bruce Momjian
Date:
Subject: Re: Mini improvement: statement_cost_limit