Skip to content

[performance] drop and recreate table take too much time and very cpu intensive #46869

@kocoten1992

Description

@kocoten1992

What is your situation?

I've a situation, when writing test case for application, for each test, I've drop all tables and recreate freshly (that help me sure database is clean to reproduce issue correctly), I've like ~50 statement of create create table, alter table..etc.

In postgres, drop all tables and recreate them is really fast (less than a second)
But in cockroachdb, it is slow and cpu instensive (1m40.103s), take a look 2 pics below:

postgres

postgres-migration

cockroachdb

cockroach-migration

Normally all my tests run within 2 mins, when I switch to cockroachdb, it take 1h34m to complete, this is quite severe, I could take 10 times slower, but this a factor of 50 and we have a cpu usage issue too.

P/s: I run cockroach start-single-node --insecure, and I use time command to measure

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions