Re: Query tuning: partitioning, DISTINCT ON, and indexing

Поиск
Список
Период
Сортировка
От bricklen
Тема Re: Query tuning: partitioning, DISTINCT ON, and indexing
Дата
Msg-id CAGrpgQ-gOVq3v=TaskKKwY5f=A5eoNvKCCKgxJugnO=paKJJPg@mail.gmail.com
обсуждение исходный текст
Ответ на Query tuning: partitioning, DISTINCT ON, and indexing  (Maciek Sakrejda <m.sakrejda@gmail.com>)
Ответы Re: Query tuning: partitioning, DISTINCT ON, and indexing  (Maciek Sakrejda <m.sakrejda@gmail.com>)
Список pgsql-performance

On Thu, Jun 20, 2013 at 6:24 PM, Maciek Sakrejda <m.sakrejda@gmail.com> wrote:
SELECT
  DISTINCT ON (type) ts, type, details
FROM
  observations
WHERE
  subject = '...'
ORDER BY
  type, ts DESC;

First thing: What is your "work_mem" set to, and how much RAM is in the machine? If you look at the plan, you'll immediately notice the "external merge Disk" line where it spills to disk on the sort. Try setting your work_mem to 120MB or so (depending on how much RAM you have, # concurrent sessions, complexity of queries etc)

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

Предыдущее
От: Maciek Sakrejda
Дата:
Сообщение: Query tuning: partitioning, DISTINCT ON, and indexing
Следующее
От: Maciek Sakrejda
Дата:
Сообщение: Re: Query tuning: partitioning, DISTINCT ON, and indexing