Is dump-reload the only cure?

From: <mallah(at)trade-india(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Is dump-reload the only cure?
Date: 2002-11-01 11:15:43
Message-ID: 1584.203.145.130.142.1036149343.squirrel@mail.trade-india.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-performance


Hi ,

For a particular table it was only dump and reload of the table that
helped in enabling index usage.

I tried VACUUM ANALYZE and even recreating the indexes but it
did not work.

why does the planner use the index like a miser?
below are the details

was there anything bettwer i could have done for indexes getting used?

regds
mallah.

Query:

explain SELECT count( email_id ) from email_bank_mailing_lists where query_id='499';
NOTICE: QUERY PLAN:

Aggregate (cost=4330.48..4330.48 rows=1 width=4)
-> Index Scan using email_bank_ml_qid on email_bank_mailing_lists (cost=0.00..4327.28
rows=1282 width=4)
EXPLAIN

distribution of query_id in table:
total: 256419

query_id | count(*)
----------------------
298 | 6167
328 | 2083
354 | 9875
404 | 6974
432 | 5059
437 | 2497
440 | 2837
448 | 14624
449 | 13053
454 | 409
455 | 3725
456 | 560
458 | 3477
460 | 5561
486 | 41842
488 | 63642
492 | 2244
493 | 6047
494 | 37415
499 | 25010
501 | 3318

before dump reload:
tradein_clients=# VACUUM VERBOSE ANALYZE email_bank_mailing_lists;
NOTICE: --Relation email_bank_mailing_lists--
NOTICE: Pages 3583: Changed 0, Empty 0; Tup 256419: Vac 0, Keep 0, UnUsed 44822.
Total CPU 0.24s/0.04u sec elapsed 0.30 sec.
NOTICE: Analyzing email_bank_mailing_lists
VACUUM
tradein_clients=# explain SELECT count( email_id ) from email_bank_mailing_lists where
query_id=499;NOTICE: QUERY PLAN:

Aggregate (cost=6863.24..6863.24 rows=1 width=4)
-> Seq Scan on email_bank_mailing_lists (cost=0.00..6788.24 rows=30001 width=4)

EXPLAIN

-----------------------------------------
Get your free web based email at trade-india.com.
"India's Leading B2B eMarketplace.!"
http://www.trade-india.com/

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Gaetano Mendola 2002-11-01 11:27:48 Reindex vs Vacuum analyze
Previous Message Stefan Stern 2002-11-01 10:40:54 readline.h / history.h error at ./configure

Browse pgsql-performance by date

  From Date Subject
Next Message Rod Taylor 2002-11-01 12:52:40 Re: [pgsql-performance] Is dump-reload the only cure?
Previous Message Justin Clift 2002-10-31 01:38:45 Re: PG_Autotune 0.1