Re: delete seems to be getting blocked

From: Jorge Godoy <godoy(at)metalab(dot)unc(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Cc: "surabhi(dot)ahuja" <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)in>
Subject: Re: delete seems to be getting blocked
Date: 2006-06-12 11:17:46
Message-ID: 200606120817.46889.godoy@metalab.unc.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Em Segunda 12 Junho 2006 04:24, surabhi.ahuja escreveu:
> hi,
> I am using postgresql 8.0.0.
> i have four tables in my database
> TAB1, has one primary key T1
>
> TAB2 , has 2 fields, one is the primary ley T2 and the other one is the
> foreign key T1(from TAB1)
>
> TAB3 also has 2 fields, one is the primary ley T3 and the other is the
> foreign key T2(from TAB2)
>
> TAB4 has 2 fields again, primary key T4 and a foreign key T3(from TAB3)
>
> the disk is 100% full.
>
> i open psql <datbase_name> and do
> delete from TAB1
>
> nothing seems to be happening for a long time, although when i do top, it
> shows postgres taking 99%.
>
> what is happening, cant delete be quickened?

Good question. It can be made better if you have all correct indices. If
you're missing some of them, and if you have a huge amount of data, then it
might take a long time since for each data on your TAB1 it will have to
search *all* data on the other tables to see if the value can be removed or
not.

To know exactly what is happening, try using strace / ltrace. You'll be able
to see where PostgreSQL is spending time and what it is doing.

--
Jorge Godoy <godoy(at)metalab(dot)unc(dot)edu>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2006-06-12 12:48:45 Re: delete seems to be getting blocked
Previous Message Martijn van Oosterhout 2006-06-12 10:07:03 Re: TOAST not working