Re: Many-to-many performance problem

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Many-to-many performance problem
Дата
Msg-id 22656.1465568025@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Many-to-many performance problem  (Rowan Seymour <rowanseymour@gmail.com>)
Ответы Re: Many-to-many performance problem  (Yves Dorfsman <yves@zioup.com>)
Список pgsql-performance
Rowan Seymour <rowanseymour@gmail.com> writes:
> Most of time, this query performs like https://explain.depesz.com/s/ksOC
> (~15ms). It's no longer using the using the msgs_inbox index, but it's
> plenty fast. However, sometimes it performs like
> https://explain.depesz.com/s/81c (67000ms)
> And if you run it again, it'll be fast again.

It looks like everything is fine as long as all the data the query needs
is already in PG's shared buffers.  As soon as it has to go to disk,
you're hurting, because disk reads seem to be taking ~10ms on average.

> Server is an Amazon RDS instance with default settings and Postgres 9.3.10,

And I think you just explained your problem.  Did you spring for adequate
guaranteed IOPS on this instance?  If not, you need to, or else live with
erratic performance.  If you did, you have a beef to raise with AWS that
you're not getting the performance you paid for.

You might be able to ameliorate matters by raising shared_buffers, but
unless your database isn't growing that approach has limited future.

            regards, tom lane


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

Предыдущее
От: Rowan Seymour
Дата:
Сообщение: Many-to-many performance problem
Следующее
От: Yves Dorfsman
Дата:
Сообщение: Re: Many-to-many performance problem