dbTalk Databases Forums  

[BUGS] pg_autovacuum reltuples bug

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] pg_autovacuum reltuples bug in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jim C. Nasby
 
Posts: n/a

Default [BUGS] pg_autovacuum reltuples bug - 05-03-2004 , 02:54 PM






There's a bug in pg_autovacuum that makes it vacuum large tables way to
frequently.

ogr=# select reltuples from pg_class where relname='ogr_summary';
reltuples
-------------
2.64411e+07
(1 row)

[2004-04-27 02:03:08 PM] table name: ogr."public"."ogr_results"
[2004-04-27 02:03:08 PM] relid: 615097; relisshared: 0
[2004-04-27 02:03:08 PM] reltuples: 7; relpages: 519951
[2004-04-27 02:03:08 PM] curr_analyze_count: 9904180; cur_delete_count: 168282
[2004-04-27 02:03:08 PM] ins_at_last_analyze: 9904180; del_at_last_vacuum: 168282
[2004-04-27 02:03:08 PM] insert_threshold: 507; delete_threshold 1014
[2004-04-27 02:03:08 PM] added table: ogr."public"."ogr_results"

I suspect the issue is on line 121:
new_tbl->reltuples = atoi(PQgetvalue(res, row, PQfnumber(res, "reltuples")));

I'm not a C coder, but doesn't atoi just take a text value and convert
it to an int? Shouldn't all the stats counters be stored as reals?
--
Jim C. Nasby, Database Consultant jim (AT) nasby (DOT) net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply With Quote
  #2  
Old   
Matthew T. O'Connor
 
Posts: n/a

Default Re: [BUGS] pg_autovacuum reltuples bug - 05-03-2004 , 03:39 PM






This is a known bug, and if fixed in CVS. It will be released as part
of 7.4.3, or just download pg_autovacuum.c and pg_autovacuum.h from cvs
and compile a new executable.

Matthew O'Connor


Jim C. Nasby wrote:
Quote:
There's a bug in pg_autovacuum that makes it vacuum large tables way to
frequently.

ogr=# select reltuples from pg_class where relname='ogr_summary';
reltuples
-------------
2.64411e+07
(1 row)

[2004-04-27 02:03:08 PM] table name: ogr."public"."ogr_results"
[2004-04-27 02:03:08 PM] relid: 615097; relisshared: 0
[2004-04-27 02:03:08 PM] reltuples: 7; relpages: 519951
[2004-04-27 02:03:08 PM] curr_analyze_count: 9904180; cur_delete_count: 168282
[2004-04-27 02:03:08 PM] ins_at_last_analyze: 9904180; del_at_last_vacuum: 168282
[2004-04-27 02:03:08 PM] insert_threshold: 507; delete_threshold 1014
[2004-04-27 02:03:08 PM] added table: ogr."public"."ogr_results"

I suspect the issue is on line 121:
new_tbl->reltuples = atoi(PQgetvalue(res, row, PQfnumber(res, "reltuples")));

I'm not a C coder, but doesn't atoi just take a text value and convert
it to an int? Shouldn't all the stats counters be stored as reals?
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.