Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Douglas Alan <darkwater42@xxxxxxxxx> writes:
> 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?
>
> explain analyze select * from maindb_astobject limit 1;

Yeah ...

>> 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)

Ouch.

I'm betting that this table is horrendously bloated and the seqscan is
picking through many thousands of dead rows before it finds the first
live one.  Cue standard questions about your vacuuming habits ...

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux