Re: [GENERAL] Fast join

From: Leon <leon(at)udmnet(dot)ru>
To: "'pgsql-general(at)hub(dot)org'" <pgsql-general(at)hub(dot)org>
Subject: Re: [GENERAL] Fast join
Date: 1999-06-29 16:37:36
Message-ID: 3778F650.D55A536@udmnet.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Herouth Maoz wrote:

> >
> > adb=> EXPLAIN SELECT COUNT(*) FROM atable WHERE atable.cfield =
> >btable.cfield
> > AND atable.afield>100;
>
> Hey, shouldn't these be:
>
> SELECT COUNT(*)
> FROM atable, btable <----- Note this!
> WHERE atable.cfield = btable.cfield
> AND ....
>
> I'm not sure that when the other table is implicit, the optimizer checks
> the statistics of the btable on time.
>

adb=> EXPLAIN SELECT * FROM atable,btable WHERE atable.cfield = btable.cfield
AND atable.afield<10;
NOTICE: QUERY PLAN:

Hash Join (cost=1052.69 rows=3334 width=40)
-> Seq Scan on btable (cost=399.00 rows=10000 width=20)
-> Hash (cost=198.67 rows=3334 width=20)
-> Index Scan using aindex on atable (cost=198.67 rows=3334 width=20)

--
Leon.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Leon 1999-06-29 16:39:43 Re: [GENERAL] Fast join
Previous Message Bruce Momjian 1999-06-29 16:01:57 Re: [GENERAL] Fast join