pg_class.reltuples not reset by VACUUM?
От | Jeff Boes |
---|---|
Тема | pg_class.reltuples not reset by VACUUM? |
Дата | |
Msg-id | b6v1p3$cp4$1@news.hub.org обсуждение исходный текст |
Ответы |
Re: pg_class.reltuples not reset by VACUUM?
|
Список | pgsql-admin |
I thought that VACUUM ANALYZE would always restore some sense of reality to the internal statistics for a table. However ... # select count(*) from job_queue; count ------- 834 (1 row) # select reltuples from pg_class where relname = 'job_queue'; reltuples ----------- 206277 (1 row) # vacuum analyze job_queue; # select reltuples from pg_class where relname = 'job_queue'; reltuples ----------- 2062xx (slightly larger number) (1 row) This is of concern to me mostly because: # explain select * from job_queue; NOTICE: QUERY PLAN: Seq Scan on job_queue (cost=0.00..5989.77 rows=206277 width=95) Obviously, the optimizer thinks that the table has 200k rows in it! -- Jeff Boes vox 616.226.9550 ext 24 Database Engineer fax 616.349.9076 Nexcerpt, Inc. http://www.nexcerpt.com ...Nexcerpt... Extend your Expertise
В списке pgsql-admin по дате отправления: