by TH12345 » Wed Nov 26, 2008 9:52 pm
From the old forum:
Poker Tracker stud> Welcome!! Where did the old forum go>can be found here>PostgreSQL forum>Sticky: How to: Defrag PT
Here is the beginning of the instructions:
How to do it. ************ updated - pgadmin was a bad idea
*******************************
In Poker Tracker, find the DB File/DB Name/DSN you want to cluster. (File-Maintain Database Names) in my case it's GAMBLOR (and it's case sensitive)
Use windows explorer to search for the file psql.exe
(for most people it will be in c:\program files\postgresql\bin\)
open a dos prompt (start-run type cmd, hit enter)
If you have limited disk space and/or a very large database, you should check how much space each table/index is using. If you KNOW you have enough space, move on to Recreate the tables
At the dos prompt, type the following after the >
"c:\program files\postgresql\bin\psql" -d "YOUR_DB_NAME" -U postgres -c "select relname, relfilenode, relpages/128 as approx_Mb from pg_class order by approx_Mb desc limit 10;"
type your password IF prompted.
this shows the approx size of the tables/indexes (and the filename if you want to look)
******* Recreate the tables *******
This will take a long time, its IO bound, my 3Gb game_players table took 3 hours.
At the dos prompt, type the following after the >
"c:\program files\postgresql\bin\psql" -d "YOUR_DB_NAME" -U postgres -c "cluster session_idx_02 on session;"
"c:\program files\postgresql\bin\psql" -d "YOUR_DB_NAME" -U postgres -c "cluster player_winnings_idx_02 on player_winnings;"
"c:\program files\postgresql\bin\psql" -d "YOUR_DB_NAME" -U postgres -c "cluster player_idx_02 on players;"
"c:\program files\postgresql\bin\psql" -d "YOUR_DB_NAME" -U postgres -c "cluster game_idx_01 on game;"
"c:\program files\postgresql\bin\psql" -d "YOUR_DB_NAME" -U postgres -c "cluster game_players_idx_05 on game_players;"
================================================================================================================================
It is the bolded part where I am wondering what to do next on. After I find the exe file, what am I supposed to do with it before I open the dos prompt?