"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 th
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 allow
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
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) or
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.
>
>
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 wh
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 q
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 moment,ti