> 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