Re: Slow query with a lot of data

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

 



On Tue, 19 Aug 2008, Moritz Onken wrote:
       tablename        | attname | n_distinct | correlation
 result                 | domain  |       1642 |           1

Well, the important thing is the correlation, which is 1, indicating that Postgres knows that the table is clustered. So I have no idea why it is sorting the entire table.

What happens when you run EXPLAIN SELECT * FROM result ORDER BY domain?

Sounds like an awfully long time to me. Also, I think restricting it to 280 users is probably not making it any faster.

If I hadn't restricted it to 280 users it would have run ~350days...

What makes you say that? Perhaps you could post EXPLAINs of both of the queries.

Matthew

--
What goes up must come down. Ask any system administrator.


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux