Is dump-reload the only cure?

Поиск
Список
Период
Сортировка
От
Тема Is dump-reload the only cure?
Дата
Msg-id 1584.203.145.130.142.1036149343.squirrel@mail.trade-india.com
обсуждение исходный текст
Ответы Re: Is dump-reload the only cure?  (Rod Taylor <rbt@rbt.ca>)
Re: [pgsql-performance] Is dump-reload the only cure?  (Robert Treat <xzilla@users.sourceforge.net>)
Список 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/



В списке pgsql-performance по дате отправления:

Предыдущее
От: Justin Clift
Дата:
Сообщение: Re: PG_Autotune 0.1
Следующее
От: Rod Taylor
Дата:
Сообщение: Re: Is dump-reload the only cure?