Slow counting on v9.3

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

 



Hi,

I'm experiecing slow count performance:

SELECT COUNT(*) AS "count"
FROM "NewsArticle"

Takes 210 ms. I've run analyze and vacuum. I'm on 9.3. Here're the stats http://d.pr/i/6YoB

I don't understand why is it that slow. It returns 1 integer, and counts without filters.

This performs quickly:

SELECT reltuples AS count
FROM pg_class
WHERE relname = 'NewsArticle';

But I'd like to add conditions so I don't like the last method.


--
Yours sincerely,
Kai Sellgren

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

  Powered by Linux