|
Thank you for the swift reply. The test server is hardly ever vacuumed as it in general sees very limited traffic. vacuum is only necessary if the server sees a lot of write operations, i.e. update, delete, insert right? What explains the different choice of query plans then? As can be seen from the following snippets the test server decides to use an index twice in Query 2, where as the live server decides to do a full scan of tables with 38.5k and 5.5k records. In Query 3 it's vice versa. Seems strange to me... Query 2: ------------------- Bad idea, price_tbl hold 38.5k records Test: -> Index Scan using aff_price_uq on price_tbl (cost=0.00..6.01 rows=1 width=4) (actual time=0.01..0.01 rows=1 loops=2838)" Live: -> Seq Scan on price_tbl (cost=0.00..883.48 rows=2434 width=4) (actual time=0.86..67.25 rows=4570 loops=1)" Filter: (affid = 8)" ------------------- Bad idea, sct2subcattype_tbl hold 5.5k records Test: -> Index Scan using subcat_uq on sct2subcattype_tbl (cost=0.00..79.26 rows=26 width=8) (actual time=0.01..0.17 rows=59 loops=48) Live: -> Seq Scan on sct2subcattype_tbl (cost=0.00..99.26 rows=5526 width=8) (actual time=0.01..30.16 rows=5526 loops=1)" Query 3: ----------------- Bad idea, sct2lang_tbl has 8.6k records Test: -> Seq Scan on sct2lang_tbl (cost=0.00..150.79 rows=8679 width=8) (actual time=0.03..10.70 rows=8679 loops=1)" Live: -> Index Scan using sct2lang_uq on sct2lang_tbl (cost=0.00..8.13 rows=2 width=8) (actual time=1.10..2.39 rows=2 loops=69)" Will get a VACUUM VERBOSE of StatCon_Tbl Cheers Jona PS: The query plans are extracted using pgAdmin on Windows, if you can recommend a better cross-platform postgre client I'd be happy to try it out. Tom Lane wrote: Jona <[EMAIL PROTECTED]> writes: |
- Re: [PERFORM] Bad choice of query plan from PG 7.3... Jona
- Re: [PERFORM] Bad choice of query plan from P... Jona
- Re: [PERFORM] Bad choice of query plan fr... Christopher Kings-Lynne
