Subject | Understanding internals of sweep process - why saves are bigger then db size? |
---|---|
Author | karolbieniaszewski |
Post date | 2012-12-29T19:31:57Z |
Hi,
i have problem with understanding internal work of sweep
my db size is 52.74GB i detach from db restart fb server and run sweep by gfix -sweep
now i see in task manager that Firebird 2.5.3.26584 write to disk 1154 GB
this is 21 times bigger then db size itself!
- db is not corrupted - it is restored from backup and then i delete 25% of date from it.
sweep process is still running.
here are details form monitoring tables and task manager
#############################################################
INSERT INTO MON$ATTACHMENTS ("DB_KEY", MON$ATTACHMENT_ID, MON$SERVER_PID, MON$STATE, MON$ATTACHMENT_NAME, MON$USER, MON$ROLE, MON$REMOTE_PROTOCOL, MON$REMOTE_ADDRESS, MON$REMOTE_PID, MON$CHARACTER_SET_ID, MON$TIMESTAMP, MON$GARBAGE_COLLECTION, MON$REMOTE_PROCESS, MON$STAT_ID) VALUES ('00000022:00000001', '833', '2516', '1', 'S:\UPDATE.CAB', 'SYSDBA ', 'NONE ', 'TCPv4', '127.0.0.1', '3432', '51', '29.12.2012, 20:13:07.855', '1', 'C:\Program Files\FlameRobin (x64)\flamerobin.exe', '2');
INSERT INTO MON$ATTACHMENTS ("DB_KEY", MON$ATTACHMENT_ID, MON$SERVER_PID, MON$STATE, MON$ATTACHMENT_NAME, MON$USER, MON$ROLE, MON$REMOTE_PROTOCOL, MON$REMOTE_ADDRESS, MON$REMOTE_PID, MON$CHARACTER_SET_ID, MON$TIMESTAMP, MON$GARBAGE_COLLECTION, MON$REMOTE_PROCESS, MON$STAT_ID) VALUES ('00000022:00000002', '831', '2516', '0', 'S:\UPDATE.CAB', 'SYSDBA ', 'NONE ', 'TCPv4', '127.0.0.1', '3472', '0', '29.12.2012, 09:24:41.841', '1', 'C:\Program Files\Firebird\Firebird_2_5\bin\gfix.exe', '5');
INSERT INTO MON$DATABASE ("DB_KEY", MON$DATABASE_NAME, MON$PAGE_SIZE, MON$ODS_MAJOR, MON$ODS_MINOR, MON$OLDEST_TRANSACTION, MON$OLDEST_ACTIVE, MON$OLDEST_SNAPSHOT, MON$NEXT_TRANSACTION, MON$PAGE_BUFFERS, MON$SQL_DIALECT, MON$SHUTDOWN_MODE, MON$SWEEP_INTERVAL, MON$READ_ONLY, MON$FORCED_WRITES, MON$RESERVE_SPACE, MON$CREATION_DATE, MON$PAGES, MON$STAT_ID, MON$BACKUP_STATE) VALUES ('00000021:00000001', 'S:\UPDATE.CAB', '16384', '11', '2', '987', '7613', '7613', '7613', '65536', '3', '0', '0', '0', '1', '1', '23.09.2012, 08:33:28.913', '3456143', '1', '0');
INSERT INTO MON$IO_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$PAGE_READS, MON$PAGE_WRITES, MON$PAGE_FETCHES, MON$PAGE_MARKS) VALUES ('00000026:00000001', '1', '0', '70996820', '69958129', '2839349590', '646437138');
INSERT INTO MON$IO_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$PAGE_READS, MON$PAGE_WRITES, MON$PAGE_FETCHES, MON$PAGE_MARKS) VALUES ('00000026:00000002', '2', '1', '84', '65273', '34571', '42');
INSERT INTO MON$IO_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$PAGE_READS, MON$PAGE_WRITES, MON$PAGE_FETCHES, MON$PAGE_MARKS) VALUES ('00000026:00000003', '3', '2', '0', '0', '81', '0');
INSERT INTO MON$IO_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$PAGE_READS, MON$PAGE_WRITES, MON$PAGE_FETCHES, MON$PAGE_MARKS) VALUES ('00000026:00000004', '4', '3', '0', '0', '1', '0');
INSERT INTO MON$IO_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$PAGE_READS, MON$PAGE_WRITES, MON$PAGE_FETCHES, MON$PAGE_MARKS) VALUES ('00000026:00000005', '5', '1', '70996556', '299527', '2839273709', '646436971');
INSERT INTO MON$IO_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$PAGE_READS, MON$PAGE_WRITES, MON$PAGE_FETCHES, MON$PAGE_MARKS) VALUES ('00000026:00000006', '6', '2', '70996508', '299525', '2839270409', '646436968');
INSERT INTO MON$MEMORY_USAGE ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$MEMORY_USED, MON$MEMORY_ALLOCATED, MON$MAX_MEMORY_USED, MON$MAX_MEMORY_ALLOCATED) VALUES ('00000029:00000001', '1', '0', '1091324032', '1093824512', '1092097992', '1094619136');
INSERT INTO MON$MEMORY_USAGE ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$MEMORY_USED, MON$MEMORY_ALLOCATED, MON$MAX_MEMORY_USED, MON$MAX_MEMORY_ALLOCATED) VALUES ('00000029:00000002', '2', '1', '26392', '0', '129968', '69632');
INSERT INTO MON$MEMORY_USAGE ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$MEMORY_USED, MON$MEMORY_ALLOCATED, MON$MAX_MEMORY_USED, MON$MAX_MEMORY_ALLOCATED) VALUES ('00000029:00000003', '3', '2', '9288', '0', '9416', '0');
INSERT INTO MON$MEMORY_USAGE ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$MEMORY_USED, MON$MEMORY_ALLOCATED, MON$MAX_MEMORY_USED, MON$MAX_MEMORY_ALLOCATED) VALUES ('00000029:00000004', '4', '3', '7976', '0', '10312', '0');
INSERT INTO MON$MEMORY_USAGE ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$MEMORY_USED, MON$MEMORY_ALLOCATED, MON$MAX_MEMORY_USED, MON$MAX_MEMORY_ALLOCATED) VALUES ('00000029:00000005', '5', '1', '10864', '0', '10864', '0');
INSERT INTO MON$MEMORY_USAGE ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$MEMORY_USED, MON$MEMORY_ALLOCATED, MON$MAX_MEMORY_USED, MON$MAX_MEMORY_ALLOCATED) VALUES ('00000029:00000006', '6', '2', '952', '0', '1824', '0');
INSERT INTO MON$RECORD_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$RECORD_SEQ_READS, MON$RECORD_IDX_READS, MON$RECORD_INSERTS, MON$RECORD_UPDATES, MON$RECORD_DELETES, MON$RECORD_BACKOUTS, MON$RECORD_PURGES, MON$RECORD_EXPUNGES) VALUES ('00000027:00000001', '1', '0', '218993535', '4660', '0', '0', '0', '480', '1720537', '106402786');
INSERT INTO MON$RECORD_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$RECORD_SEQ_READS, MON$RECORD_IDX_READS, MON$RECORD_INSERTS, MON$RECORD_UPDATES, MON$RECORD_DELETES, MON$RECORD_BACKOUTS, MON$RECORD_PURGES, MON$RECORD_EXPUNGES) VALUES ('00000027:00000002', '2', '1', '13678', '2142', '0', '0', '0', '0', '0', '0');
INSERT INTO MON$RECORD_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$RECORD_SEQ_READS, MON$RECORD_IDX_READS, MON$RECORD_INSERTS, MON$RECORD_UPDATES, MON$RECORD_DELETES, MON$RECORD_BACKOUTS, MON$RECORD_PURGES, MON$RECORD_EXPUNGES) VALUES ('00000027:00000003', '3', '2', '0', '41', '0', '0', '0', '0', '0', '0');
INSERT INTO MON$RECORD_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$RECORD_SEQ_READS, MON$RECORD_IDX_READS, MON$RECORD_INSERTS, MON$RECORD_UPDATES, MON$RECORD_DELETES, MON$RECORD_BACKOUTS, MON$RECORD_PURGES, MON$RECORD_EXPUNGES) VALUES ('00000027:00000004', '4', '3', '0', '0', '0', '0', '0', '0', '0', '0');
INSERT INTO MON$RECORD_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$RECORD_SEQ_READS, MON$RECORD_IDX_READS, MON$RECORD_INSERTS, MON$RECORD_UPDATES, MON$RECORD_DELETES, MON$RECORD_BACKOUTS, MON$RECORD_PURGES, MON$RECORD_EXPUNGES) VALUES ('00000027:00000005', '5', '1', '218963899', '84', '0', '0', '0', '480', '1720537', '106402786');
INSERT INTO MON$RECORD_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$RECORD_SEQ_READS, MON$RECORD_IDX_READS, MON$RECORD_INSERTS, MON$RECORD_UPDATES, MON$RECORD_DELETES, MON$RECORD_BACKOUTS, MON$RECORD_PURGES, MON$RECORD_EXPUNGES) VALUES ('00000027:00000006', '6', '2', '218962490', '0', '0', '0', '0', '480', '1720537', '106402786');
INSERT INTO MON$TRANSACTIONS ("DB_KEY", MON$TRANSACTION_ID, MON$ATTACHMENT_ID, MON$STATE, MON$TIMESTAMP, MON$TOP_TRANSACTION, MON$OLDEST_TRANSACTION, MON$OLDEST_ACTIVE, MON$ISOLATION_MODE, MON$LOCK_TIMEOUT, MON$READ_ONLY, MON$AUTO_COMMIT, MON$AUTO_UNDO, MON$STAT_ID) VALUES ('00000023:00000001', '7638', '833', '1', '29.12.2012, 20:15:08.700', '7638', '987', '7638', '1', '-1', '0', '0', '1', '3');
INSERT INTO MON$TRANSACTIONS ("DB_KEY", MON$TRANSACTION_ID, MON$ATTACHMENT_ID, MON$STATE, MON$TIMESTAMP, MON$TOP_TRANSACTION, MON$OLDEST_TRANSACTION, MON$OLDEST_ACTIVE, MON$ISOLATION_MODE, MON$LOCK_TIMEOUT, MON$READ_ONLY, MON$AUTO_COMMIT, MON$AUTO_UNDO, MON$STAT_ID) VALUES ('00000023:00000002', '7535', '831', '0', '29.12.2012, 09:24:41.893', '7535', '987', '7597', '2', '-1', '1', '0', '1', '6');
#############################################################
db properties from flamerobin
Database info
ODS Version
11.2
Page Size
16384
Pages
3456143
Size on Disk
52.74GB
SQL Dialect
3
Default Character Set
WIN1250
Settings
Page Buffers
65536
Sweep Interval
0
Forced Writes
Reserve Space
Read-Only
Transaction info
Oldest transaction
987
Oldest active transaction
7640
Oldest snapshot
7640
Next transaction
7640
#############################################################
in task manager
reads in bytes
1 171 128 163 589
saves in bytes
1 154 298 740 882
Karol Bieniaszewski
i have problem with understanding internal work of sweep
my db size is 52.74GB i detach from db restart fb server and run sweep by gfix -sweep
now i see in task manager that Firebird 2.5.3.26584 write to disk 1154 GB
this is 21 times bigger then db size itself!
- db is not corrupted - it is restored from backup and then i delete 25% of date from it.
sweep process is still running.
here are details form monitoring tables and task manager
#############################################################
INSERT INTO MON$ATTACHMENTS ("DB_KEY", MON$ATTACHMENT_ID, MON$SERVER_PID, MON$STATE, MON$ATTACHMENT_NAME, MON$USER, MON$ROLE, MON$REMOTE_PROTOCOL, MON$REMOTE_ADDRESS, MON$REMOTE_PID, MON$CHARACTER_SET_ID, MON$TIMESTAMP, MON$GARBAGE_COLLECTION, MON$REMOTE_PROCESS, MON$STAT_ID) VALUES ('00000022:00000001', '833', '2516', '1', 'S:\UPDATE.CAB', 'SYSDBA ', 'NONE ', 'TCPv4', '127.0.0.1', '3432', '51', '29.12.2012, 20:13:07.855', '1', 'C:\Program Files\FlameRobin (x64)\flamerobin.exe', '2');
INSERT INTO MON$ATTACHMENTS ("DB_KEY", MON$ATTACHMENT_ID, MON$SERVER_PID, MON$STATE, MON$ATTACHMENT_NAME, MON$USER, MON$ROLE, MON$REMOTE_PROTOCOL, MON$REMOTE_ADDRESS, MON$REMOTE_PID, MON$CHARACTER_SET_ID, MON$TIMESTAMP, MON$GARBAGE_COLLECTION, MON$REMOTE_PROCESS, MON$STAT_ID) VALUES ('00000022:00000002', '831', '2516', '0', 'S:\UPDATE.CAB', 'SYSDBA ', 'NONE ', 'TCPv4', '127.0.0.1', '3472', '0', '29.12.2012, 09:24:41.841', '1', 'C:\Program Files\Firebird\Firebird_2_5\bin\gfix.exe', '5');
INSERT INTO MON$DATABASE ("DB_KEY", MON$DATABASE_NAME, MON$PAGE_SIZE, MON$ODS_MAJOR, MON$ODS_MINOR, MON$OLDEST_TRANSACTION, MON$OLDEST_ACTIVE, MON$OLDEST_SNAPSHOT, MON$NEXT_TRANSACTION, MON$PAGE_BUFFERS, MON$SQL_DIALECT, MON$SHUTDOWN_MODE, MON$SWEEP_INTERVAL, MON$READ_ONLY, MON$FORCED_WRITES, MON$RESERVE_SPACE, MON$CREATION_DATE, MON$PAGES, MON$STAT_ID, MON$BACKUP_STATE) VALUES ('00000021:00000001', 'S:\UPDATE.CAB', '16384', '11', '2', '987', '7613', '7613', '7613', '65536', '3', '0', '0', '0', '1', '1', '23.09.2012, 08:33:28.913', '3456143', '1', '0');
INSERT INTO MON$IO_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$PAGE_READS, MON$PAGE_WRITES, MON$PAGE_FETCHES, MON$PAGE_MARKS) VALUES ('00000026:00000001', '1', '0', '70996820', '69958129', '2839349590', '646437138');
INSERT INTO MON$IO_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$PAGE_READS, MON$PAGE_WRITES, MON$PAGE_FETCHES, MON$PAGE_MARKS) VALUES ('00000026:00000002', '2', '1', '84', '65273', '34571', '42');
INSERT INTO MON$IO_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$PAGE_READS, MON$PAGE_WRITES, MON$PAGE_FETCHES, MON$PAGE_MARKS) VALUES ('00000026:00000003', '3', '2', '0', '0', '81', '0');
INSERT INTO MON$IO_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$PAGE_READS, MON$PAGE_WRITES, MON$PAGE_FETCHES, MON$PAGE_MARKS) VALUES ('00000026:00000004', '4', '3', '0', '0', '1', '0');
INSERT INTO MON$IO_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$PAGE_READS, MON$PAGE_WRITES, MON$PAGE_FETCHES, MON$PAGE_MARKS) VALUES ('00000026:00000005', '5', '1', '70996556', '299527', '2839273709', '646436971');
INSERT INTO MON$IO_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$PAGE_READS, MON$PAGE_WRITES, MON$PAGE_FETCHES, MON$PAGE_MARKS) VALUES ('00000026:00000006', '6', '2', '70996508', '299525', '2839270409', '646436968');
INSERT INTO MON$MEMORY_USAGE ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$MEMORY_USED, MON$MEMORY_ALLOCATED, MON$MAX_MEMORY_USED, MON$MAX_MEMORY_ALLOCATED) VALUES ('00000029:00000001', '1', '0', '1091324032', '1093824512', '1092097992', '1094619136');
INSERT INTO MON$MEMORY_USAGE ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$MEMORY_USED, MON$MEMORY_ALLOCATED, MON$MAX_MEMORY_USED, MON$MAX_MEMORY_ALLOCATED) VALUES ('00000029:00000002', '2', '1', '26392', '0', '129968', '69632');
INSERT INTO MON$MEMORY_USAGE ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$MEMORY_USED, MON$MEMORY_ALLOCATED, MON$MAX_MEMORY_USED, MON$MAX_MEMORY_ALLOCATED) VALUES ('00000029:00000003', '3', '2', '9288', '0', '9416', '0');
INSERT INTO MON$MEMORY_USAGE ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$MEMORY_USED, MON$MEMORY_ALLOCATED, MON$MAX_MEMORY_USED, MON$MAX_MEMORY_ALLOCATED) VALUES ('00000029:00000004', '4', '3', '7976', '0', '10312', '0');
INSERT INTO MON$MEMORY_USAGE ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$MEMORY_USED, MON$MEMORY_ALLOCATED, MON$MAX_MEMORY_USED, MON$MAX_MEMORY_ALLOCATED) VALUES ('00000029:00000005', '5', '1', '10864', '0', '10864', '0');
INSERT INTO MON$MEMORY_USAGE ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$MEMORY_USED, MON$MEMORY_ALLOCATED, MON$MAX_MEMORY_USED, MON$MAX_MEMORY_ALLOCATED) VALUES ('00000029:00000006', '6', '2', '952', '0', '1824', '0');
INSERT INTO MON$RECORD_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$RECORD_SEQ_READS, MON$RECORD_IDX_READS, MON$RECORD_INSERTS, MON$RECORD_UPDATES, MON$RECORD_DELETES, MON$RECORD_BACKOUTS, MON$RECORD_PURGES, MON$RECORD_EXPUNGES) VALUES ('00000027:00000001', '1', '0', '218993535', '4660', '0', '0', '0', '480', '1720537', '106402786');
INSERT INTO MON$RECORD_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$RECORD_SEQ_READS, MON$RECORD_IDX_READS, MON$RECORD_INSERTS, MON$RECORD_UPDATES, MON$RECORD_DELETES, MON$RECORD_BACKOUTS, MON$RECORD_PURGES, MON$RECORD_EXPUNGES) VALUES ('00000027:00000002', '2', '1', '13678', '2142', '0', '0', '0', '0', '0', '0');
INSERT INTO MON$RECORD_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$RECORD_SEQ_READS, MON$RECORD_IDX_READS, MON$RECORD_INSERTS, MON$RECORD_UPDATES, MON$RECORD_DELETES, MON$RECORD_BACKOUTS, MON$RECORD_PURGES, MON$RECORD_EXPUNGES) VALUES ('00000027:00000003', '3', '2', '0', '41', '0', '0', '0', '0', '0', '0');
INSERT INTO MON$RECORD_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$RECORD_SEQ_READS, MON$RECORD_IDX_READS, MON$RECORD_INSERTS, MON$RECORD_UPDATES, MON$RECORD_DELETES, MON$RECORD_BACKOUTS, MON$RECORD_PURGES, MON$RECORD_EXPUNGES) VALUES ('00000027:00000004', '4', '3', '0', '0', '0', '0', '0', '0', '0', '0');
INSERT INTO MON$RECORD_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$RECORD_SEQ_READS, MON$RECORD_IDX_READS, MON$RECORD_INSERTS, MON$RECORD_UPDATES, MON$RECORD_DELETES, MON$RECORD_BACKOUTS, MON$RECORD_PURGES, MON$RECORD_EXPUNGES) VALUES ('00000027:00000005', '5', '1', '218963899', '84', '0', '0', '0', '480', '1720537', '106402786');
INSERT INTO MON$RECORD_STATS ("DB_KEY", MON$STAT_ID, MON$STAT_GROUP, MON$RECORD_SEQ_READS, MON$RECORD_IDX_READS, MON$RECORD_INSERTS, MON$RECORD_UPDATES, MON$RECORD_DELETES, MON$RECORD_BACKOUTS, MON$RECORD_PURGES, MON$RECORD_EXPUNGES) VALUES ('00000027:00000006', '6', '2', '218962490', '0', '0', '0', '0', '480', '1720537', '106402786');
INSERT INTO MON$TRANSACTIONS ("DB_KEY", MON$TRANSACTION_ID, MON$ATTACHMENT_ID, MON$STATE, MON$TIMESTAMP, MON$TOP_TRANSACTION, MON$OLDEST_TRANSACTION, MON$OLDEST_ACTIVE, MON$ISOLATION_MODE, MON$LOCK_TIMEOUT, MON$READ_ONLY, MON$AUTO_COMMIT, MON$AUTO_UNDO, MON$STAT_ID) VALUES ('00000023:00000001', '7638', '833', '1', '29.12.2012, 20:15:08.700', '7638', '987', '7638', '1', '-1', '0', '0', '1', '3');
INSERT INTO MON$TRANSACTIONS ("DB_KEY", MON$TRANSACTION_ID, MON$ATTACHMENT_ID, MON$STATE, MON$TIMESTAMP, MON$TOP_TRANSACTION, MON$OLDEST_TRANSACTION, MON$OLDEST_ACTIVE, MON$ISOLATION_MODE, MON$LOCK_TIMEOUT, MON$READ_ONLY, MON$AUTO_COMMIT, MON$AUTO_UNDO, MON$STAT_ID) VALUES ('00000023:00000002', '7535', '831', '0', '29.12.2012, 09:24:41.893', '7535', '987', '7597', '2', '-1', '1', '0', '1', '6');
#############################################################
db properties from flamerobin
Database info
ODS Version
11.2
Page Size
16384
Pages
3456143
Size on Disk
52.74GB
SQL Dialect
3
Default Character Set
WIN1250
Settings
Page Buffers
65536
Sweep Interval
0
Forced Writes
Reserve Space
Read-Only
Transaction info
Oldest transaction
987
Oldest active transaction
7640
Oldest snapshot
7640
Next transaction
7640
#############################################################
in task manager
reads in bytes
1 171 128 163 589
saves in bytes
1 154 298 740 882
Karol Bieniaszewski