I cannot understand why the following two queries differ so much in execution
time (almost ten times)
Query A (two queries)
select distinct moment.mid from moment,timecard where parent = 45 and (pid=17
and timecard.mid = moment.mid) order by moment.mid;
select distinct moment.mid from
am Wed, dem 23.04.2008, um 9:23:07 +0200 mailte Hans Ekbrand folgendes:
I cannot understand why the following two queries differ so much in execution
time (almost ten times)
wild guess: different execution plans.
Can you show us the plans? (EXPLAIN ANALYSE SELECT ...)
Query A (two
am Wed, dem 23.04.2008, um 9:58:10 +0200 mailte A. Kretschmer folgendes:
Query A (two queries)
select distinct moment.mid from moment,timecard where parent = 45 and
(pid=17 and timecard.mid = moment.mid) order by moment.mid;
select distinct moment.mid from moment,timecard where
On Wed, Apr 23, 2008 at 09:58:10AM +0200, A. Kretschmer wrote:
am Wed, dem 23.04.2008, um 9:23:07 +0200 mailte Hans Ekbrand folgendes:
I cannot understand why the following two queries differ so much in
execution time (almost ten times)
wild guess: different execution plans.
Can
On Wed, Apr 23, 2008 at 10:57:04AM +0200, A. Kretschmer wrote:
am Wed, dem 23.04.2008, um 9:58:10 +0200 mailte A. Kretschmer folgendes:
Query A (two queries)
select distinct moment.mid from moment,timecard where parent = 45 and
(pid=17 and timecard.mid = moment.mid) order by
On 23 Apr 2008, at 9:23AM, Hans Ekbrand wrote:
I cannot understand why the following two queries differ so much in
execution time (almost ten times)
Query A (two queries)
select distinct moment.mid from moment,timecard where parent = 45
and (pid=17 and timecard.mid = moment.mid) order by
I should say that this is on postgresql 7.4.16 (debian stable).
Whoa.
I cannot understand why the following two queries differ so much in
execution time (almost ten times)
Post EXPLAIN ANALYZE for both, and also post table definitions (with
indexes), use \d table. This will
Hans Ekbrand [EMAIL PROTECTED] writes:
No, I just wanted to show the time differences, I haven't used join
before. Now that you have adviced me to, I have tried your suggestion
to rewrite B as a union and it works good! Just as fast as the A Query!
You can even do better. If you know the two