Re: help with understanding EXPLAIN and boosting performance

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: help with understanding EXPLAIN and boosting performance
Дата
Msg-id 7191.1287167703@sss.pgh.pa.us
обсуждение исходный текст
Ответ на help with understanding EXPLAIN and boosting performance  (Brandon Casci <brandon@loudcaster.com>)
Список pgsql-performance
Brandon Casci <brandon@loudcaster.com> writes:
> I have an application hosted on Heroku. They use postgres. It's more or less
> abstracted away, but I can get some performance data from New Relic. For the
> most part, performance is ok, but now and then some queries take a few
> seconds, and spike up to 15 or even 16 seconds! Ouch!

The particular query you're showing here doesn't look terribly
expensive.  Are you sure this is one that took that long?

If you're seeing identical queries take significantly different times,
I'd wonder about what else is happening on the server.  The most obvious
explanation for that type of behavior is that everything is swapped into
RAM when it's fast, but has to be read from disk when it's slow.  If
that's what's happening you should consider buying more RAM or
offloading some activities to other machines, so that there's not so
much competition for memory space.

If specific queries are consistently slow then EXPLAIN might give some
useful info about those.  It's unlikely to tell you much about
non-reproducible slowdowns, though.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Index scan / Index cond limitation or ?
Следующее
От: "Igor Neyman"
Дата:
Сообщение: Re: oracle to psql migration - slow query in postgres