Search Postgresql Archives

Re: SELECT DISTINCT very slow

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

 



In response to Ben Harper <rogojin@xxxxxxxxx>:
> Hi,
> Can anybody explain this:
> 
> Records: 600,000
> Field Width: Approximately 20 UTF8 characters - type is VARCHAR(25)
> Field is Indexed.
> 
> SELECT DISTINCT field FROM table;
> 
> Takes about 6 seconds. There are 111 distinct items.

What's the output of EXPLAIN ANALYZE SELECT DISTINCT field FROM table;?

Does a VACUUM ANALYZE of the table help?  Is the query significantly
faster the second time you run it?

> Is this a well known issue?

Not that I'm aware of.

-- 
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

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