EnterpriseDB: The Enterprise Postgres Company Postgres Plus Forums: The PostgreSQL Open Source Database from EnterpriseDB
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 

truncating the table data  XML

Forum Index » GridSQL - Developers
Author Message
Venkat_B

Member

Joined: 16 Jun 2008 08:39:02
Messages: 45
Offline

Hi,

Truncating in GridSQL is taking lot of time even for very minimum number of rows.

Thanx
Mason_S

Senior member

Joined: 1 Apr 2008 09:03:08
Messages: 380
Offline

Hi Venkat,

Does this eventually return?

There really is no magic going on here, GridSQL simply passes the TRUNCATE command down to all of the nodes that the table is partitioned on. I am not sure why it would take longer.

Thanks,

Mason
[WWW]
Venkat_B

Member

Joined: 16 Jun 2008 08:39:02
Messages: 45
Offline

Hi Mason,

Thanks for the reply,

But the table containing only 5 to 10 rows in a table which is non partitioned also taking lots of time and finally there is no result.
Is there any place like log file to check where it is getting choked.

Thanks
Mason_S

Senior member

Joined: 1 Apr 2008 09:03:08
Messages: 380
Offline

Hi Venkat,

This is working for me:

gstest2=> create table trunctest (col1 int, col2 int) on node 1;
OK
gstest2=> insert into trunctest values (1, 2);
INSERT 0 1
gstest2=> insert into trunctest values (3, 4);
INSERT 0 1
gstest2=> truncate trunctest;
OK

Note that truncating requires an exclusive lock on the table.

If I start another session, do a begin work, and insert, and in a separate session try and truncate, the truncate will appear to hang, because it cannot get an exclusive lock. I am guessing that the table is probably being used in another session(?).

Regards,

Mason


[WWW]
 
Forum Index » GridSQL - Developers
Go to:   
Powered by JForum 2.1.8 © JForum Team