473,386 Members | 1,708 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

7.3.3 drop table takes very long time

I'm trying to drop a table and it's taking a very long time. There has been
a lot of modification to the table and it has a lot of old data still being
used as a result of not using the vacuum function enough. I ran an insert
into and it was taking a long time (ran for about 48 hours) so I aborted it.
I tried vacuuming it and that ran for about the same amount of time before I
aborted. I figured the fastest ting would be to drop the table and re-create
it.
I tried running a pg_dump and it ran for about 4 days without putting any of
the data to the output file.
I started the drop table command yesterday and it's been running for almost
24 hours.
I know it's processing because it's using up the CPU and I can run
transactions on all of the other tables except this one. It has about
132,000 records in the table.
Any ideas on how I can speed this up?
Can I go into the /data directory and find the file that contains that table
and delete that? If so, how would I go about doing this?
Eric

__________________________________________________ _______________
Expand your wine savvy — and get some great new recipes — at MSN Wine.
http://wine.msn.com
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 12 '05 #1
5 8637
"Eric Freeman" <ej**@hotmail.com> writes:
I started the drop table command yesterday and it's been running for almost
24 hours.


You're stuck in some kind of infinite loop --- there's no way that DROP
should take any noticeable amount of time. I'm guessing that the system
catalog entries for this particular table are corrupted somehow, but no
idea just how. It would be worth trying to track it down in case there
is a PG bug lurking.

Can you attach to the looping backend with a debugger and get a stack
trace for us?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #2
Tom Lane wrote:
"Eric Freeman" <ej**@hotmail.com> writes:

I started the drop table command yesterday and it's been running for almost
24 hours.


You're stuck in some kind of infinite loop --- there's no way that DROP
should take any noticeable amount of time. I'm guessing that the system
catalog entries for this particular table are corrupted somehow, but no
idea just how. It would be worth trying to track it down in case there
is a PG bug lurking.

Can you attach to the looping backend with a debugger and get a stack
trace for us?

Is there any possibility that he's got an open transacation sitting out
there for days holding a lock on that table?

Mike Mascari

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #3
Mike Mascari <ma*****@mascari.com> writes:
Is there any possibility that he's got an open transacation sitting out
there for days holding a lock on that table?


Good thought ... but if that was the issue then the DROP would just be
sleeping waiting for the lock, and Eric did say it was consuming CPU ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #4
On Thursday 08 January 2004 9:14 am, Mike Mascari wrote:
Tom Lane wrote:
"Eric Freeman" <ej**@hotmail.com> writes:
I started the drop table command yesterday and it's been running
for almost 24 hours.


You're stuck in some kind of infinite loop --- there's no way that
DROP should take any noticeable amount of time. I'm guessing
that the system catalog entries for this particular table are
corrupted somehow, but no idea just how. It would be worth
trying to track it down in case there is a PG bug lurking.

Can you attach to the looping backend with a debugger and get a
stack trace for us?


Is there any possibility that he's got an open transacation sitting
out there for days holding a lock on that table?

Mike Mascari


Yesterday I had someone drop a table while a pg_dumpall was running.
The drop didn't complete till the dump was done.

Cheers,
Steve

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #5
Steve Crawford <sc*******@pinpointresearch.com> writes:
On Thursday 08 January 2004 9:14 am, Mike Mascari wrote:
Is there any possibility that he's got an open transacation sitting
out there for days holding a lock on that table?
Yesterday I had someone drop a table while a pg_dumpall was running.
The drop didn't complete till the dump was done.


Yup, because pg_dump takes an AccessShareLock (reader's lock) on every
table it intends to dump. But the process wanting to drop the table
would have been blocked on the lock, and would not have been chewing any
CPU time while it waited. Eric seems to be seeing something different.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bennett Haselton | last post by:
I have a MySQL query running inside a CGI script on my site that, at random intervals, seems to take 10-20 seconds to complete instead of less than 1 second. I spent so much time trying to track...
3
by: David Link | last post by:
Hi All, Here's a Conditional drop_table func for those interested. There was a thread on this a long time back. We do this all the time : DELETE TABLE sales; CREATE TABLE sales (...);
2
by: tom horner | last post by:
Any ideas on why drop and create alias statements would take a long time? We recently went through an upgrade of our production database, which included alter statements to table structures,...
5
by: IdeaMan | last post by:
Windows 2000 Access 97 I am working on an issue tracking DB, where I need to link (not attach due to size)screen prints of various system errors. I have created a public folder on a network...
2
by: Dragon | last post by:
When I run a make-table query, the results take over 1 minute to return. The query is making a table that has 12,000 records in it. If I run the make-table query ONLY to see the records that will...
2
by: VM | last post by:
When I display data to a Windows datagrid I usually fill the underlying table (in another class) and then, once it contains all the data, I attach it to the grid. But there are some processes that...
2
by: tpaulson | last post by:
I have a couple of DIV's that I hide/display based on radio buttons. On the DIV's, I have multiple drop down boxes. The source shows that they are populated, but I can't make them drop down. Only...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
14
by: Philth | last post by:
Hi there, I've essentially got a form with several drop down, each populated by columns in various tables. The populating bit works fine - the column rows appear as they should in the menu. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.