Re: [HACKERS] Bug? relpages, reltuples resets to zero
От | Bruce Momjian |
---|---|
Тема | Re: [HACKERS] Bug? relpages, reltuples resets to zero |
Дата | |
Msg-id | 199810222116.RAA07260@candle.pha.pa.us обсуждение исходный текст |
Ответ на | Bug? relpages, reltuples resets to zero (jwieck@debis.com (Jan Wieck)) |
Список | pgsql-hackers |
> Hi, > > there seems to be a problem with the relation statistics in > pg_class. Could someone explain why this happens? > > doc=> vacuum; > VACUUM > doc=> select relname, relpages, reltuples from pg_class > doc-> where relname = 'doc_wordref'; > relname |relpages|reltuples > -----------+--------+--------- > doc_wordref| 1099| 136027 > (1 row) > > -- ******** That's right > > doc=> explain select distinct refpage from doc_wordref > doc-> where refword ~ '^a'; > NOTICE: QUERY PLAN: > Attached is a patch to vacuum.c I would like you to try. I wonder if dirty pages are somehow never getting written out because of vacuum's use of transactions. -- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026 *** ./backend/commands/vacuum.c.orig Thu Oct 22 17:14:37 1998 --- ./backend/commands/vacuum.c Thu Oct 22 17:15:35 1998 *************** *** 1875,1886 **** heap_close(sd); } - /* XXX -- after write, should invalidate relcache in other backends */ - WriteNoReleaseBuffer(ItemPointerGetBlockNumber(&rtup->t_ctid)); - RelationInvalidateHeapTuple(rd, rtup); ! ReleaseBuffer(buffer); heap_close(rd); } --- 1875,1885 ---- heap_close(sd); } RelationInvalidateHeapTuple(rd, rtup); ! /* XXX -- after write, should invalidate relcache in other backends */ ! WriteBuffer(ItemPointerGetBlockNumber(&rtup->t_ctid)); ! heap_close(rd); }
В списке pgsql-hackers по дате отправления: