-
Notifications
You must be signed in to change notification settings - Fork 4.1k
create/drop table (with/without foreign key) take too long #47512
Copy link
Copy link
Closed
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.O-communityOriginated from the communityOriginated from the communityX-blathers-triagedblathers was able to find an ownerblathers was able to find an owner
Description
Describe the problem
I've open #46869, but doesn't have concrete example, allowed me to recreate this with clear example and close the old one.
To Reproduce
root@:5432/defaultdb> CREATE DATABASE test_database;
CREATE DATABASE
Time: 78.922975ms
USE test_database;
SET
Time: 1.104456ms
root@:5432/test_database> CREATE TABLE buyers (
id UUID PRIMARY KEY
);
CREATE TABLE
Time: 33.952167ms
root@:5432/test_database> CREATE TABLE cars (
id UUID PRIMARY KEY,
preferred_buyer_id UUID,
CONSTRAINT cars_preferred_buyer_id_fkey FOREIGN KEY (preferred_buyer_id) REFERENCES buyers (id)
);
CREATE TABLE
Time: 6.709753419s
root@:5432/test_database> DROP TABLE cars CASCADE;
DROP TABLE
Time: 7.105337403s
root@:5432/test_database> DROP TABLE buyers CASCADE;
DROP TABLE
Time: 6.990172606s
use defaultdb;
root@:5432/defaultdb> drop database test_database;
DROP DATABASE
Time: 6.794767354s
Expected behavior
Some operation take almost 7s to run, something is wrong with:
- create table with foreign key
- drop table
- drop database
There is no reason I'd need to wait 6s to create/drop (I'm using single-node-cluster, but even for real cluster, 7s would be too slow)
Environment:
- CockroachDB version: master
- Server OS: [e.g. Linux/Distrib]
- Client app
cockroach sql
Additional context
What was the impact? Unable integrate testing application with database
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.O-communityOriginated from the communityOriginated from the communityX-blathers-triagedblathers was able to find an ownerblathers was able to find an owner