Re: How can I manually alter the statistics for a column?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Douglas Alan <darkwater42(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: How can I manually alter the statistics for a column?
Date: 2009-06-02 21:47:24
Message-ID: 20090602214724.GL5845@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Douglas Alan escribió:

> Hey, while I have you on the line, might you be so kind as to explain why
> this query is so slow? Shouldn't it just fetch the first row in the table?
> What could be faster than that?
>
> explain analyze select * from maindb_astobject limit 1;
> >
> > QUERY
> > PLAN
> >
> > ------------------------------------------------------------------------------------------------------------------------------------
> > Limit (cost=0.00..0.04 rows=1 width=78) (actual time=8091.962..8091.965
> > rows=1 loops=1)
> > -> Seq Scan on maindb_astobject (cost=0.00..3358190.12 rows=75426912
> > width=78) (actual time=8091.955..8091.955 rows=1 loops=1)
> > Total runtime: 8092.040 ms
> > (3 rows)

Maybe there's a bunch of pages with only dead tuples at the start of the
table? Maybe a lot of empty pages at the start of the table (If this
is 8.3 you have to consider sync_seqscan as well)

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-06-02 21:48:05 Re: How can I manually alter the statistics for a column?
Previous Message Douglas Alan 2009-06-02 21:36:50 Re: How can I manually alter the statistics for a column?