dbTalk Databases Forums  

[BUGS] BUG #2394: Multiple TRUNCATE within transaction

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2394: Multiple TRUNCATE within transaction in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Alexander Kirpa
 
Posts: n/a

Default [BUGS] BUG #2394: Multiple TRUNCATE within transaction - 04-15-2006 , 08:36 AM







The following bug has been logged online:

Bug reference: 2394
Logged by: Alexander Kirpa
Email address: postgres (AT) bilteks (DOT) com
PostgreSQL version: 8.1.3
Operating system: FreeBSD 6.0
Description: Multiple TRUNCATE within transaction
Details:

Within one transaction each 'TRUNCATE TABLE' - "generate" as minimum one
file: 1 for table plus one on each index.

In case of many truncate (10-100 thousands or more) within one transaction,
postgres receive serious performance problem for current operation (create
and delete 100K files in not to easy task for filesystem) and, in future,
some system wide (postgres) performance lost as result of big size (1-2MB in
my case) of database directory.

IMHO, need create new file only for first of truncate command. For 2, 3, ...
'truncate table' within one transaction need simple truncate self file(s),
this also improve performance especially in case using of temporary tables
by avoid write temporary date on disk.

Best regards,
Alexander Kirpa

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #2394: Multiple TRUNCATE within transaction - 04-15-2006 , 11:18 AM






"Alexander Kirpa" <postgres (AT) bilteks (DOT) com> writes:
Quote:
In case of many truncate (10-100 thousands or more) within one transaction,
postgres receive serious performance problem for current operation (create
Why in the world are you doing that, and why do you think we need to
optimize that case? We don't have infinite manpower, so if you
want this case optimized you had better explain why it deserves
consideration ahead of the long list of other problems ...

Quote:
IMHO, need create new file only for first of truncate command. For 2, 3, ...
'truncate table' within one transaction need simple truncate self file(s),
this also improve performance especially in case using of temporary tables
by avoid write temporary date on disk.
This "simple" fix is pretty debatable anyway because of the existence
of intra-transaction MVCC rules.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.