PDA

View Full Version : sql query for deleting old imported hands



lusop
11-15-2009, 03:10 PM
Hi there,

Since I'm buying datamined hands, now I have a lot of hands of old levels where I'm not playing and I would like to put those off my DB. It's now huge!!!

It would be something like (pseucoded):

delete *
from players, gametypes, poker_hands...
where
players.player <> ME_in_the_alias
AND gametypes.gametype_id <> my_actual_level
AND gametypes.gametype_id <> the_inmediately_old_level
AND [associating them all]
any idea or help!

thanks!
Sete

fozzy71
11-15-2009, 04:46 PM
You should regularly purge mined hands in your database: http://www.holdemmanager.net/faq/afmviewfaq.aspx?faqid=107

Use our Purge process to completely delete the hands from your DB. This process will regain you the most space. - http://www.holdemmanager.net/faq/afmviewfaq.aspx?faqid=152

I would suggest you turn off logging on your SQL installation as well as these other performance improvements - Top 10: HEM performance increase tips

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.

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