Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 14th, 2005, 03:07 PM
a07272 a07272 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 4 a07272 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 27 m
Reputation Power: 0
Question Database Size problem?? Please Help

Dear All

I am currently doing a number pattern analyzing program. I use Firebird as my database, Delphi as my dev. tool.

I use only 3 table, and no more then 10000 rows of data. Each data is less then 200 byte.

But after program finish, the database it grow to 202MB . Then I backup the database, it shink back to 56KB. Can anyone tell me what's happening? Or anyway I can keep the database small. Thanks...

Reply With Quote
  #2  
Old April 15th, 2005, 03:55 AM
fikret fikret is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Sarajevo, Bosnia
Posts: 111 fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 5 h 17 m 43 sec
Reputation Power: 8
Quote:
Originally Posted by a07272
Dear All

I am currently doing a number pattern analyzing program. I use Firebird as my database, Delphi as my dev. tool.

I use only 3 table, and no more then 10000 rows of data. Each data is less then 200 byte.

But after program finish, the database it grow to 202MB . Then I backup the database, it shink back to 56KB. Can anyone tell me what's happening? Or anyway I can keep the database small. Thanks...


That's because your program is creating a lot of record versions when you have a lot of transactions. Don't worry, Firebird will recycle that space, and it will work faster next time because there is no need to allocate space on disk.

--
Best regards,
Fikret Hasovic http://fikret.fbtalk.net
USAID TAMP Senior Programmer
* FirebirdSQL Foundation member.
- Join today at http://www.firebirdsql.org/ff/foundation
* JEDI VCS contributor
http://jedivcs.sourceforge.net/
* Firebird and Fyracle news
http://www.fyracle.org/shownews.php

Reply With Quote
  #3  
Old April 15th, 2005, 01:40 PM
a07272 a07272 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 4 a07272 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 27 m
Reputation Power: 0
Thank you for the reply . But it's there any way, I can stop the record versioning? Or limited the size of transaction log?

Just like you said, the program it self use a lot of transaction. If I use the ordinary harddisk to run it, then it will take about 2~3 week to finish one cycle of pattern analyzing , which is too slow. So I put the database file on a ramdisk,can refer to http://www.superspeed.com/servers/ramdisk.php. It really speed up, but just eat up too much memory .

Btw, during the program running, I even use the gfix -sweep to force clean up the free space, but It seeks not working. It's there a gfix problem ? Or gfix don't apply on firebird ?

Reply With Quote
  #4  
Old April 17th, 2005, 10:09 AM
SilverDB's Avatar
SilverDB SilverDB is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Romania
Posts: 173 SilverDB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 45 m 53 sec
Reputation Power: 5
Send a message via Yahoo to SilverDB
Why don't you use only one transaction ?
Do a "hard commit" (commit) instead of a "soft commit" (commit retaining).

Reply With Quote
  #5  
Old April 17th, 2005, 06:19 PM
a07272 a07272 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 4 a07272 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 27 m
Reputation Power: 0
Quote:
Originally Posted by SilverDB
Why don't you use only one transaction ?
Do a "hard commit" (commit) instead of a "soft commit" (commit retaining).


Sorry, I don't understand what you mean ? What is the differences between "hard commit" and "soft commit" ? I do commit every transation manully.

In the program, I use 15 thread to process the data. Each thread contain two transaction component, one for select and update, one for delete(wipe out the calculated data).
So the program process flow like this:
1.Initial thread
2.getting data(each thread)
3.process each record(start / commit update transation)
4.Wipe out the calculated data(start / commit delete transction)
5.repeat step 2 to 5 until end of data

So can you please help me, point out where might be wrong?
Thank you....^_^

Reply With Quote
  #6  
Old April 18th, 2005, 07:23 AM
fikret fikret is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Sarajevo, Bosnia
Posts: 111 fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 5 h 17 m 43 sec
Reputation Power: 8
Please post your question on firebird support list (yahoo group).
You will get much more answers than here...

--
Best regards,
Fikret Hasovic http://fikret.fbtalk.net
USAID TAMP Senior Programmer
* FirebirdSQL Foundation member.
- Join today at http://www.firebirdsql.org/ff/foundation
* JEDI VCS contributor
http://jedivcs.sourceforge.net/
* Firebird and Fyracle news
http://www.fyracle.org/shownews.php

Reply With Quote
  #7  
Old April 19th, 2005, 02:27 AM
SilverDB's Avatar
SilverDB SilverDB is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Romania
Posts: 173 SilverDB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 45 m 53 sec
Reputation Power: 5
Send a message via Yahoo to SilverDB
Lightbulb

Quote:
Originally Posted by a07272
...
1.Initial thread
2.getting data(each thread)
3.process each record(start / commit update transation)
4.Wipe out the calculated data(start / commit delete transction)
5.repeat step 2 to 5 until end of data
...


I really don't understand why do you use the database ... if you "clean" it up at the end ... you should do all the processing without the database then maybe ?

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Database Size problem?? Please Help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway