From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Arjen van der Meijden <acm(at)tweakers(dot)net> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Weird query plans for my queries, causing terrible performance. |
Date: | 2003-01-31 15:30:32 |
Message-ID: | 8771.1044027032@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Arjen van der Meijden <acm(at)tweakers(dot)net> writes:
> That is weird, a copy&paste of your command into my psql results in:
> [different results]
Hm, there must be some difference on this query between 7.3 and CVS tip
then; I was not expecting that. [ ... a debugger is fired up ... time
passes ... ]
Ah hah. There's a rather shaky heuristic in canonicalize_qual that
prefers DNF if certain things are true, one of them being that the
qual condition mentions only one relation. This test is being fooled
because you wrote some of the variables with "F_Topics." and some
without (which means that, according to the letter of the SQL spec,
they refer to the join relation's result and not the original table).
I find that 7.3 will produce the desired plan if I write all the
variables in the WHERE clause the same way, either with or without
"F_Topics.". CVS tip doesn't show this effect because it handles join
variables differently.
So that's your workaround for the moment. As I was saying, this code
could use some fresh ideas...
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2003-01-31 15:55:07 | Re: serialization errors |
Previous Message | codeWarrior | 2003-01-31 15:25:42 | Re: Query gone wild |