Re: [HACKERS] pgsql: Apply a band-aid fix for the problem that 8.2 and up completely

2007-08-31 Thread Gregory Stark

Tom Lane [EMAIL PROTECTED] writes:

 Log Message:
 ---
 Apply a band-aid fix for the problem that 8.2 and up completely misestimate
 the number of rows likely to be produced by a query such as
   SELECT * FROM t1 LEFT JOIN t2 USING (key) WHERE t2.key IS NULL;

I'm a little wary of backpatching planner logic changes like this and another
instance in the past.

Even if the new logic is better in 99% of cases people with existing systems
will have already dealt with the 99% of cases where the existing releases come
up with poor plans. It seems the only people this patch will affect are the 1%
for whom the old planner works fine and upgrading breaks their application.

I'm not sure I would advocate rolling this particular commit back though,
especially since there's already at least one other planner change iirc.
Perhaps just noting the planner changes specifically in the release
announcement as possible compatibility gotchas is what's needed.


-- 
  Gregory Stark
  EnterpriseDB  http://www.enterprisedb.com

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] pgsql: Apply a band-aid fix for the problem that 8.2 and up completely

2007-08-31 Thread Tom Lane
Gregory Stark [EMAIL PROTECTED] writes:
 Tom Lane [EMAIL PROTECTED] writes:
 Log Message:
 ---
 Apply a band-aid fix for the problem that 8.2 and up completely misestimate
 the number of rows likely to be produced by a query such as
 SELECT * FROM t1 LEFT JOIN t2 USING (key) WHERE t2.key IS NULL;

 I'm a little wary of backpatching planner logic changes like this and another
 instance in the past.

I probably wouldn't have even made this patch if 8.2's behavior weren't
so completely broken on an important class of query.  For a significant
number of people, this is a bug fix.

In any case, there have been planner changes much larger than this
committed into the 8.2 branch since release --- both the outer join
rearrangement logic and choose_bitmap_and have needed significant
surgery.

regards, tom lane

---(end of broadcast)---
TIP 6: explain analyze is your friend