Mark Starkman <mark.starkman@xxxxxxxxxxxx> wrote: > I'm not sure how to get it to return in > reasonable amount of time. Some more information could help. What version of PostgreSQL is this? Please give an overview of the hardware and OS. Please show your postgresql.conf file, excluding comments. Please run your query with EXPLAIN ANALYZE in front, so we can see the execution plan, with cost estimates compared to actual information. If the the plan indicates a sequential scan, and you think an indexed scan may be faster, you might be able to coerce it into the indexed plan for diagnostic purposes by running this on the connection before an EXPLAIN ANALYZE run: set enable_seqscan = off; You don't want to leave it off, or try to use that in production, but it might be useful in figuring out what's going on. That might be enough to diagnose the issue. -Kevin -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance