Re: Querying a Large Partitioned DB

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: Querying a Large Partitioned DB
Дата
Msg-id 1239533857.16396.50.camel@ebony.2ndQuadrant
обсуждение исходный текст
Ответ на Querying a Large Partitioned DB  (Justin Funk <funkju@iastate.edu>)
Список pgsql-general
On Fri, 2009-04-10 at 09:15 -0500, Justin Funk wrote:

> I need to be able to do full text searches on the message field, and
> of course, it needs to be reasonably fast.
>
> The table is partitioned daily and has this structure:

> My typical query looks like this:
> SELECT * FROM SystemEvents WHERE message_index_col @@
> to_tsquery('english', 'Term')  LIMIT 25 OFFSET 0;

The partitioning does nothing to improve your typical query.

Loop through the tables from first to last until you have returned 25
records. That way you won't have to wait to search every table.

--
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Training, Services and Support


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Minimizing Recovery Time (wal replication)
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: No return from trigger function