RE: [firebird-support] Gbaked and restored database larger than the original?
Take a look here: http://www.firebirdfaq.org/faq361/ I'd add that restore also has a -use_all_space option. If you don't specify this, then pages are filled to approximately 80% (80% is preferable over 100% unless it is a read-only database). See http://www.firebirdsql.org/manual/gbak-cmdline.html or http://www.firebirdsql.org/manual/gfix-pagespace.html for more information. Set -Original Message- From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Sent: 8. juli 2015 11:48 To: firebird-support@yahoogroups.com Subject: [firebird-support] Gbaked and restored database larger than the original? Hi, Just for my cursiosity and for a better understanding of Firebird: what can be a possible reason for a gbaked and restored (to a different file) database being _larger_ than the original one? I've got a db of size 104521728 bytes. I do gbak -B -T database.fdb database.gbk, then gbak -C database.gbk newdatabase.fdb. The size of newdatabase.fdb is 104751104 (~ 200kB more). I'm the only one messing with these databases, the platform is Linux x64, Firebird 2.5.2, all operations performed on the same machine, in the same file system. Before the backup-restore, a quite large chunk of metadata was added/altered in the original database (procedures, fields), which is the only clue I can think of at the moment (adding a default value to a field which had none?). It's quite obvious why a restored database might be smaller than the original one (no garbage), but the other way around is a bit puzzling. Both databases seem to work fine, so I'm in no trouble, but my ignorance in this matter bothers me nonetheless ;) I'd be grateful for any plausible explanations. thanks in advance and best regards Tomasz Posted by: Tomasz Tyrakowski ++ Visit http://www.firebirdsql.org and click the Documentation item on the main (top) menu. Try FAQ and other links from the left-side menu there. Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ ++ Yahoo Groups Links
RE: [firebird-support] Gbaked and restored database larger than the original?
On Wed, 8 Jul 2015 12:14:13 +, "Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]" wrote: > Take a look here: http://www.firebirdfaq.org/faq361/ > > I'd add that restore also has a -use_all_space option. If you don't > specify this, then pages are filled to approximately 80% (80% is preferable > over 100% unless it is a read-only database). See > http://www.firebirdsql.org/manual/gbak-cmdline.html or > http://www.firebirdsql.org/manual/gfix-pagespace.html for more information. Another reason could be restoring with a different page size than the original database. Mark
Re: [firebird-support] Gbaked and restored database larger than the original?
On 2015-07-08 o 14:14, Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support] wrote: > Take a look here: http://www.firebirdfaq.org/faq361/ Yes, I've come across this on another occasion, but it doesn't seem to apply to my case (I didn't switch to a different version of FB). > I'd add that restore also has a -use_all_space option. If you don't specify > this, then pages are filled to approximately 80% (80% is preferable over 100% > unless it is a read-only database). See > http://www.firebirdsql.org/manual/gbak-cmdline.html or > http://www.firebirdsql.org/manual/gfix-pagespace.html for more information. And that's most probably the bull's eye! After restoring with -use_all_space, the database size is 94445568 bytes. Thanks a lot Svein. regards Tomasz
Re: [firebird-support] Gbaked and restored database larger than the original?
W dniu 2015-07-08 o 14:18, Mark Rotteveel m...@lawinegevaar.nl [firebird-support] wrote: > Another reason could be restoring with a different page size than the > original database. Both databases have 8k pages. Tomasz -- __--==--__ __--== Tomasz Tyrakowski==--__ __--==SOL-SYSTEM==--__ __--== http://www.sol-system.pl ==--__ __--==--__
Re: [firebird-support] Gbaked and restored database larger than the original?
> On Jul 8, 2015, at 8:14 AM, Svein Erling Tysvær > svein.erling.tysv...@kreftregisteret.no [firebird-support] > wrote: > > Take a look here: http://www.firebirdfaq.org/faq361/ > > I'd add that restore also has a -use_all_space option. If you don't specify > this, then pages are filled to approximately 80% (80% is preferable over 100% > unless it is a read-only database). See > http://www.firebirdsql.org/manual/gbak-cmdline.html or > http://www.firebirdsql.org/manual/gfix-pagespace.html for more information. > Just being pedantic here. The space reserved depends on the size of the record - the full declared size plus the record header (approx 14 bytes). Firebird computes the number of records that could fit on the page and reserves 16 bytes per record. So if your records are big, you'll reserve less space. A record that consists of a single integer could reserve nearly half the page. Best regards, Ann