PDA

View Full Version : cleaning my database



Macka
11-18-2009, 08:54 PM
Hi,

my database size is getting out of hand, so I would like to delete all observed hands that are older than 3 months. Can someone guide me how to do that pls?

Regards,
Michal

fozzy71
11-19-2009, 12:24 AM
You should regularly purge mined hands in your databas:
http://www.holdemmanager.net/faq/afmviewfaq.aspx?faqid=107


I would also suggest you turn off logging and delete all your old logs. They often take up a large portion of your DB size.

To turn off logging, follow these instructions. This is the first thing I do anytime I install SQL for someone.

- Start > My Computer > Tools > Folder Options > View > UnCheck 'Hide Extensions for known file types' > OK

- C:\Program Files\PostgreSQL\data\postgresql.conf > Right-Click > Open With.. > NotePad > Check 'Always use this program'

- Scroll about half way down to ~Lines 245 - 260:

- The last line of this block of code, for the 'logging_collector', must be changed from On to Off.



------------------------------------------------------------------------------
# ERROR REPORTING AND LOGGING
#------------------------------------------------------------------------------

# - Where to Log -

log_destination = 'stderr' # Valid values are combinations of
# stderr, csvlog, syslog and eventlog,
# depending on platform. csvlog
# requires logging_collector to be on.

# This is used when logging to stderr:
logging_collector = off # Enable capturing of stderr and csvlog


File > Save; File > Close

Start > Programs > PostgreSQL 8.3 > Reload Configuration.


- Start > My Computer > C:\Program Files\PostgreSQL\data\pg_log, or C:\Program Files (x86)\PostgreSQL\data\pg_log, if you have 64 bit Vista. Delete all files in that folder. And it might be a good idea to empty your recycle bin at that point, or use a 3rd party utility like CCleaner to clean up all your junk/temporary files. You want to do this before you get to the vacuum and defrag process.


After you purge and delete your log files, vacuum / full analyze the database via pgadmin.

http://www.holdemmanager.net/faq/afmviewfaq.aspx?faqid=163



and check the performance tips from the link in my signature.

thomasstuart
11-19-2009, 06:45 AM
Hi,

I am also searching for this important code for deleting the database,and here I got that very well..I have applied that,It works nice.That helps me a lot.Thank you so much for sharing this post with that code and related information..

Macka
11-19-2009, 08:11 AM
Thanks a lot Fozzy.