Re: Querying a Large Partitioned DB - Mailing list pgsql-general

From Simon Riggs
Subject Re: Querying a Large Partitioned DB
Date
Msg-id 1239533857.16396.50.camel@ebony.2ndQuadrant
Whole thread Raw
In response to Querying a Large Partitioned DB  (Justin Funk <funkju@iastate.edu>)
List 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 by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Minimizing Recovery Time (wal replication)
Next
From: Simon Riggs
Date:
Subject: Re: No return from trigger function