-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: dropping a very small table is very slow #38111
Copy link
Copy link
Closed
Labels
C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Description
Running on master at 33f9a3c, a single node on my laptop.
I created a small table, inserted several rows into it, and attempted to drop it. I expected it to be an instant operation, but it was taking longer than a few seconds, so I ctrl-c'ed the cli. Now, I can neither drop the table or create a new one with the same name. Here is the log:
root@:26257/defaultdb> CREATE TABLE nondroppable (a INT PRIMARY KEY);
CREATE TABLE
Time: 4.641ms
root@:26257/defaultdb> INSERT INTO nondroppable VALUES (1), (2), (3);
INSERT 3
Time: 6.225ms
root@:26257/defaultdb> DROP TABLE nondroppable;
^C
(ctrl-c'ed here after a few seconds)
root@:26257/defaultdb> DROP TABLE nondroppable;
pq: relation "nondroppable" does not exist
root@:26257/defaultdb> CREATE TABLE nondroppable (a INT PRIMARY KEY);
pq: relation "nondroppable" already exists
Note that dropping an empty table works fine:
root@:26257/defaultdb> CREATE TABLE nondroppable (a INT PRIMARY KEY);
CREATE TABLE
Time: 5.463ms
root@:26257/defaultdb> DROP TABLE nondroppable;
DROP TABLE
Time: 30.659ms
The jobs page shows the "dropping" job in "Draining names" stage.

The issue persists after the node restart.
Assigning @dt for triage (since I guess it is a schema change operation?).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)