Re: another "EXPLAIN -- NO INDEX?" question

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: will trillich <will(at)serensoft(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: another "EXPLAIN -- NO INDEX?" question
Date: 2002-02-10 18:36:37
Message-ID: 20020210103521.A70659-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, 10 Feb 2002, will trillich wrote:

> On Sun, Feb 10, 2002 at 11:29:57AM -0500, Tom Lane wrote:
> > Try 7.2, and don't forget to VACUUM ANALYZE after you've loaded the
> > data.
>
> i'm stuck with 7.1 for now, and i do the vacuum analyze
> nightly... any other ideas?
>
> ---------
>
> create index hits_by_server on hits(server);
>
> hits=# explain
> hits-# select * from hits where (server = 1 or server = 3);
>
> NOTICE: QUERY PLAN:
> Seq Scan on hits (cost=0.00..8537.01 rows=20205 width=90)
> EXPLAIN
>
> hits=# select count(*) from hits;
> count
> --------
> 266611
> (1 row)
>
> hits=# select count(*) from hits where (server=1 or server=3);
> count
> -------
> 3678
> (1 row)

Is there one value that's more common? It's estimating about 6 times
as many rows as actually match the condition (and 3 times the =1 or =3
real for even just one of them iirc from the first message).

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marc G. Fournier 2002-02-10 18:38:44 Re: what's the meaning of the word "Tioga" in source
Previous Message Dean@TMDT 2002-02-10 17:55:36 Re: I can't find any build-in fucntions, aggregates, etc...