Re: Performance question 83 GB Table 150 million rows, distinct select

Поиск
Список
Период
Сортировка
От Alan Hodgson
Тема Re: Performance question 83 GB Table 150 million rows, distinct select
Дата
Msg-id 201111161527.57443.ahodgson@simkin.ca
обсуждение исходный текст
Ответ на Performance question 83 GB Table 150 million rows, distinct select  (Tory M Blue <tmblue@gmail.com>)
Ответы Re: Performance question 83 GB Table 150 million rows, distinct select
Список pgsql-performance
On November 16, 2011 02:53:17 PM Tory M Blue wrote:
> We now have about 180mill records in that table. The database size is
> about 580GB and the userstats table which is the biggest one and the
> one we query the most is 83GB.
>
> Just a basic query takes 4 minutes:
>
> For e.g. select count(distinct uid) from userstats where log_date
> >'11/7/2011'
>
> Just not sure if this is what to expect, however there are many other
> DB's out there bigger than ours, so I'm curious what can I do?

That query should use an index on log_date if one exists. Unless the planner
thinks it would need to look at too much of the table.

Also, the normal approach to making large statistics tables more manageable is
to partition them by date range.

В списке pgsql-performance по дате отправления:

Предыдущее
От: Tory M Blue
Дата:
Сообщение: Performance question 83 GB Table 150 million rows, distinct select
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Performance question 83 GB Table 150 million rows, distinct select