Open Side Menu Go to the Top

11-30-2010 , 03:13 AM
I have PostgreSQL installed on my computer. It is taking up a lot of space. The data folder is 17.6 GB. This seems like an awful lot, and my C: is getting full.

I believe I originally installed this program so that PT3 would work, but I don't use PT3 anymore, I use HEM.

I have a few questions:

If I uninstall PostgreSQL, will HEM still work properly? Will my HEM database be affected?

Will it likely affect anything else on my computer?

Should I uninstall it from the Control Panel?

Also, if I decide not to uninstall it, is there a particular reason it's taking up this much space? I have 267,880 players in my HEM database, if that matters. (Note my HMArchive folder is only like 47MB) Is there anything I can do about it?

Thanks very much,
Ryan
PostgreSQL question Quote
PostgreSQL question
150% up to $2,000 Welcome Bonus on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
PostgreSQL question
11-30-2010 , 06:51 AM
PostgreSQL hogging disk space can have a couple of reasons:
  1. Logfiles: look into data/pg_log, maybe you just need to do some cleanup there.
  2. Vacuum: try to run "VACUUM FULL" (should be a button in HEM somewhere) every once in a while, that should return unused blocks to the operating system.
  3. If you don't use your PT3 data anymore, maybe you can delete that database.


You can find out how much space your databases use with:

Code:
select datname as database, pg_size_pretty(pg_database_size(datname)) as size from pg_database order by size desc;
You can measure the actual space taken up by tables in a particular database with the following (after connecting to that database):

Code:
SELECT schemaname, tablename,
pg_size_pretty(size) AS size_pretty,
pg_size_pretty(total_size) AS total_size_pretty
FROM (SELECT *,
pg_relation_size(schemaname||'.'||tablename) AS size,
pg_total_relation_size(schemaname||'.'||tablename) AS total_size
FROM pg_tables) AS TABLES
ORDER BY total_size DESC;
PostgreSQL question Quote
11-30-2010 , 09:02 AM
The problem is PT3 leaves logging enabled. You need postgresql installed for your HM database. If you dont use PT3 you can probably delete the old PT3 database. http://faq.holdemmanager.com/questio...elete+Database


Logging:

I would suggest you turn off logging on your new SQL installation as well as these other performance improvements in my signature - 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.


HTML Code:
------------------------------------------------------------------------------
# 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.



Regarding database maintenance:

You should regularly purge mined hands in your database, after purge vacuum / full analyze the database via pgadmin. You do not want to purge any Hero hands so make sure your alias is properly configured before purging.
http://faq.holdemmanager.com/questio...+from+Database


Then you can vacuum/analyze, etc.

http://faq.holdemmanager.com/questio...s+Optimization

1 - Options > Database Management... > Connect > Optimize

2 - Select the Database from the Optimization window

3 - I recommend you use the [x] Quick option once a week, or every 10k - 30k hands

4 - Optimize > Yes

Wait for it to finish and change the greyed out Exit button back to a selectable option.


Once a month, or every 50 - 100k hands, you should run a [x] Standard or [x] Full option, instead of the Quick Optimization.


Next we need to Stop the PostgreSQL service so the Defragmenter can Defrag the Database.

Start > Programs > PostgreSQL 8,4 > Stop Server

Open Smart Defrag - http://www.iobit.com/iobitsmartdefrag.html

Select both drive letter checkboxes > Analyze

Pick suggested Defrag process > Start Defrag


After Smart Defrag finishes you should restart your computer.

If you need to use HM before you restart your PC, then you need to Start Server.

Start > Programs > PostgreSQL 8,4 > Start Server


*If your Database is on a SSD (Solid-State Drive) you do NOT want to do a defragment.

**If you have a SSD and install the Smart Defrag software you want to open the Auto Defrag tab and disable the [ ] Enable Auto Defrag. On the Schedule tab you should turn off the [ ] Enable Schedule. On the Options tab you should enable the [x] Do not display flash drivers and solid-state drivers. That will make sure your SSD is never defragmented, on purpose, or by accident.
PostgreSQL question Quote
PostgreSQL question
150% up to $2,000 Welcome Bonus on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
PostgreSQL question

      
m