Skip to content

sql: dropping a very small table is very slow #38111

@yuzefovich

Description

@yuzefovich

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.
Screen Shot 2019-06-07 at 10 22 10 PM

The issue persists after the node restart.

Assigning @dt for triage (since I guess it is a schema change operation?).

Metadata

Metadata

Assignees

Labels

C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions