Re: bug in JOIN or COUNT or ... ?

From: The Hermit Hacker <scrappy(at)hub(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: bug in JOIN or COUNT or ... ?
Date: 2001-05-13 00:47:12
Message-ID: Pine.BSF.4.33.0105122145100.629-100000@mobile.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 12 May 2001, Tom Lane wrote:

> The Hermit Hacker <scrappy(at)hub(dot)org> writes:
> > So why is it counting 12 more images then are actually found/exist:
>
> Hm. Could we see the EXPLAIN output for both of those?

without count:

NOTICE: QUERY PLAN:

Unique (cost=8.66..8.67 rows=1 width=37)
-> Sort (cost=8.66..8.66 rows=1 width=37)
-> Nested Loop (cost=0.00..8.65 rows=1 width=37)
-> Nested Loop (cost=0.00..6.52 rows=1 width=33)
-> Nested Loop (cost=0.00..4.26 rows=1 width=29)
-> Index Scan using status_gid on status s (cost=0.00..2.23 rows=1 width=12)
-> Index Scan using images_gid on images i (cost=0.00..2.02 rows=1 width=17)
-> Index Scan using personal_data_gid on personal_data pd (cost=0.00..2.25 rows=1 width=4)
-> Index Scan using relationship_wanted_gid on relationship_wanted rw (cost=0.00..2.11 rows=1 width=4)

EXPLAIN

with count:

NOTICE: QUERY PLAN:

Unique (cost=8.68..8.69 rows=1 width=37)
-> Sort (cost=8.68..8.68 rows=1 width=37)
-> Aggregate (cost=8.66..8.67 rows=1 width=37)
-> Group (cost=8.66..8.67 rows=1 width=37)
-> Sort (cost=8.66..8.66 rows=1 width=37)
-> Nested Loop (cost=0.00..8.65 rows=1 width=37)
-> Nested Loop (cost=0.00..6.52 rows=1 width=33)
-> Nested Loop (cost=0.00..4.26 rows=1 width=29)
-> Index Scan using status_gid on status s (cost=0.00..2.23 rows=1 width=12)
-> Index Scan using images_gid on images i (cost=0.00..2.02 rows=1 width=17)
-> Index Scan using personal_data_gid on personal_data pd (cost=0.00..2.25 rows=1 width=4)
-> Index Scan using relationship_wanted_gid on relationship_wanted rw (cost=0.00..2.11 rows=1 width=4)

EXPLAIN

>
> regards, tom lane
>

Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy(at)hub(dot)org secondary: scrappy(at){freebsd|postgresql}.org

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-05-13 00:54:27 Re: 7.2 items
Previous Message Tom Lane 2001-05-13 00:00:42 Re: 7.2 items