On Thu, Jan 7, 2010 at 9:11 PM, akp geek <akpgeek@xxxxxxxxx> wrote: > Hi All - > I have query in production and test. The tables in both the > environment has the same structure ,indexes and constraints. But the in the > test and the prod the explain plan is totally different. In test environment > the query is taking long time and noticed that indexes are not being > utilized ? I am not able to figure it Can you please share your thoughts? Assuming you've got the same data in both servers, or data that's at least similar enough to get the same query plan then it's likely that the test db needs analyzing or vacuuming. If you run the same query on each machine with explain analyze, what do you get? i.e.: explain analyze select ... (rest of your query here) -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general