Re: splitting a table? - Mailing list pgsql-general

From Arjen van der Meijden
Subject Re: splitting a table?
Date
Msg-id 001401c33739$71511a70$3ac15e91@acm
Whole thread Raw
In response to Re: splitting a table?  (Richard Huxton <dev@archonet.com>)
List pgsql-general
> Richard Huxton wrote

> You could split the table and build a view that UNIONs the
> individual tables,
> but that's not very elegant and 10 million records isn't much.
I think that union-solution would be quite a bit slower than simply
searching through the table.

> Things to check for:
>  - Have you run VACCUM FULL or VACUUM ANALYSE recently?
>  - Are your "where" data-types the same as the index data-types?
>  - See if the indexes are used in the EXPLAIN ANALYSE output.
And of course whether the hd-parameters are set in case of an ide disk,
whether there is sufficient memory allocated for the shared buffers,
etc.

It may also be wise to have multiple indexes. If you, for instance,
search very often on a combination of values and very often on a single
value two indexes (the combined one and the separate one) could improve
both queries. Although the combined index would be used in both cases if
that were the only index, it isn't the most efficient index to use in
that case, afaik.

Arjen




pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: splitting a table?
Next
From: "Johnson, Shaunn"
Date:
Subject: Re: splitting a table?