Re: SourceForge & Postgres

From: mlw <markw(at)mohawksoft(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: SourceForge & Postgres
Date: 2000-12-12 12:17:00
Message-ID: 3A36173C.DBDE879F@mohawksoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
>
> mlw <markw(at)mohawksoft(dot)com> writes:
> > cdinfo=# explain select * from ztitles where artistid = 0 ;
> > NOTICE: QUERY PLAN:
>
> > Index Scan using ztitles_artistid_ndx on ztitles (cost=0.00..5915.01
> > rows=3163 width=296)
>
> > When postmaster is started without "-o -fs" I get this:
>
> > cdinfo=# explain select * from ztitles where artistid = 0 ;
> > NOTICE: QUERY PLAN:
>
> > Seq Scan on ztitles (cost=0.00..4740.75 rows=3163 width=296)
>
> How many tuples are in the table? How many are actually returned
> by this query? Also, what do you get from
>
> select attname,attdisbursion,s.*
> from pg_statistic s, pg_attribute a, pg_class c
> where starelid = c.oid and attrelid = c.oid and staattnum = attnum
> and relname = 'ztitles';

I have attached the output.

btw anyone trying this query should use: "attdispersion"

The explain I gave, there are no records that actually have an artistid
of 0. However, I will show the explain with a valid artistid number.

This is without "-o -fs"
cdinfo=# explain select * from ztitles where artistid = 100000220 ;
NOTICE: QUERY PLAN:

Seq Scan on ztitles (cost=0.00..4740.75 rows=3163 width=296)

EXPLAIN

And this is with "-o -fs"

cdinfo=# explain select * from ztitles where artistid = 100000220 ;
NOTICE: QUERY PLAN:

Index Scan using ztitles_artistid_ndx on ztitles (cost=0.00..5915.01
rows=3163 width=296)

EXPLAIN

select count(*) from ztitles where artistid = 100000220 ;
count
-------
16
(1 row)

--
http://www.mohawksoft.com

Attachment Content-Type Size
out text/plain 4.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Horst Herb 2000-12-12 12:37:43 HELP! foreign eys & inheritance
Previous Message Zeugswetter Andreas SB 2000-12-12 08:32:35 AW: SourceForge & Postgres