Re: [PERFORM] Same query - Slow in production

2006-05-10 Thread Tom Lane
Brian Wipf <[EMAIL PROTECTED]> writes: > I'm trying to determine why an identical query is running > approximately 500 to 1000 times slower on our production database > compared to our backup database server. It looks to me like it's pure luck that the query is fast on the backup server. The

Re: [PERFORM] Same query - Slow in production

2006-05-10 Thread Brian Wipf
I added to the exists query qualifier: AND cp.category_id = 1000962 (in addition to the cp.category_id = ac.category_id) Now I am getting a much better query plan on our production server: Index Scan using attribute_category__category_id_fk_idx on attribute_category ac (cost=0.00..485.71 ro

[PERFORM] Same query - Slow in production

2006-05-10 Thread Brian Wipf
I'm trying to determine why an identical query is running approximately 500 to 1000 times slower on our production database compared to our backup database server. Both database servers are dual 2.3 GHz G5 Xserves running PostgreSQL 8.1.3; both are configured with 8GB of RAM with identical