Re: database performance and query performance question

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: database performance and query performance question
Дата
Msg-id 200401221200.45188.josh@agliodbs.com
обсуждение исходный текст
Ответ на database performance and query performance question  ("Shea,Dan [CIS]" <Dan.Shea@ec.gc.ca>)
Ответы Re: database performance and query performance question
Список pgsql-performance
Dan,

> Should there be less columns in the index?
> How can we improve database performance?
> How should I improve my query?

Your query plan isn't the problem.  It's a good plan, and a reasonably
efficient query.   Under other circumstances, the SELECT DISTINCT with the
to_char could be a performance-killer, but it's not in that result set.

Overall, you're taking 9 seconds to scan 93 million records.  Is this the time
the first time you run the query, or the 2nd and successive times?

When did you last run VACUUM ANALYZE on the table?   Have you tried increasing
the ANALYZE statistics on the index columns to, say, 500?

Your disks are RAID 5.  How many drives?  In RAID5, more drives improves the
speed of large scans.

And what's your sort_mem setting?   You didn't mention it.

Why is your effective cache size only 300mb when you have 3 GB of RAM?  It's
not affecting this query, but it could affect others.

--
-Josh Berkus
 Aglio Database Solutions
 San Francisco


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

Предыдущее
От: "Shea,Dan [CIS]"
Дата:
Сообщение: database performance and query performance question
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: database performance and query performance question