From: mallah@trade-india.com
To: pgsql-admin@postgresql.org
Cc: pgsql-performance@postgresql.org
Subject: Is dump-reload the only cure?
Date: Fri, 1 Nov 2002 16:45:43 +0530 (IST)
Message-ID: <1584.203.145.130.142.1036149343.squirrel@mail.trade-india.com> (raw)
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/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: mallah@trade-india.com, pgsql-performance@postgresql.org
Subject: Re: Is dump-reload the only cure?
In-Reply-To: <1584.203.145.130.142.1036149343.squirrel@mail.trade-india.com>
References: <1584.203.145.130.142.1036149343.squirrel@mail.trade-india.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox