On Tue, 2012-10-16 at 16:08 +1300, Jeremy Wells wrote:
> I'm running a query to do a count with two joins in it. I've added
> indexes to the tables for the join columns, but the explain of the query
> doesn't seem to be using the indexes:
Can you post the output of EXPLAIN ANALYZE? Did you do an ANALYZE of the
tables already?
You can often force an index scan by doing:
SET enable_seqscan=false;
So also try setting that, and run EXPLAIN ANALYZE again, and see if it
uses the indexes, and if so, if it's faster.
Regards,
Jeff Davis