Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Strange behavio...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 15512 of 15975
Post > Topic >>

Strange behaviour - performance decreases after each TRUNCATE

by "IVO GELOV" <ivo_gelov@[EMAIL PROTECTED] > May 12, 2008 at 10:39 PM

Hallow.
My name is IVO GELOV. Please excuse my English, it is not my primary
language.
I've started to learn PostgreSQL with version 8.1, doing 2 upgrades - to
8.2.4 and now 8.3.1
I consider myself still a novice. Currently I'm porting our small
warehouse application from MySQL to Postgre. After
designing tables, indexes and triggers, I wrote several PHP scripts to
transfer data from MySQL to Postgre. Since there
are much more checks in my new schema in Postgre, I've able to find many
discrepancies inside the old MySQL data.
This "trial and error" process resulted in many restarts of PHP scripts
for data transfer. Each of my scripts transfers one
table at a time. It always begins with TRUNCATE CASCADE, and then all the
other SQL is between BEGIN/COMMIT,
forming a transaction.
Most of my tables are small - the biggest one is BALANCE with about 840
000 records (all the others are under 150 000).
Each script shows its execution time at the end. I've noticed something
strange - first time the construction of
table BALANCE took 419 seconds, and after then each time I run the script
- it shows more and more time. I read in documentation,
that indexes may "bloat" - I saw that indexes of several tables (including
BALANCE) were 90% fragmented, so I did
REINDEX for the whole database. But the running time of the script for
BALANCE still increases - it is now 1190 seconds !
I'm really confused why is this happening. Am I misunderstanding something
? Can anybody help me or just point me ?

Thanks.




 1 Posts in Topic:
Strange behaviour - performance decreases after each TRUNCATE
"IVO GELOV" <  2008-05-12 22:39:07 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Fri Jul 4 9:38:04 CDT 2008.