prisma-engines icon indicating copy to clipboard operation
prisma-engines copied to clipboard

Make Query Engine tests faster on CockroachDB

Open pimeys opened this issue 3 years ago • 6 comments

It's almost an hour right now in the CI. Somebody said creating schemas on CockroachDB is much slower than creating databases, so maybe now when we have our own provider for CDB, we could try if creating databases for every test would make more sense and we could get that test runtime under 30 minutes again.

pimeys avatar Jun 28 '22 16:06 pimeys

(Let's also ask the Cockroach ppl again, maybe we are missing obvious stuff.) (Which reminds me that they told us to use a memory disk via a startup parameter in the past - I think we never actually got that to work. We should try again.)

janpio avatar Jun 28 '22 16:06 janpio

We have one idea to test:

  • Change creating a new schema to creating a new database. This may make it faster.

matthewmueller avatar Aug 05 '22 14:08 matthewmueller

Change creating a new schema to creating a new database. This may make it faster.

This is going to be a requirement for multi-schema tests, and that is coming soon, so you could deal with the two problems in one go.

As a data point, the introspection and migration test suites do one-database-per test and they are slow, but not by an integer multiple of the postgres test times.

tomhoule avatar Aug 07 '22 15:08 tomhoule

Next steps:

  • Read answers from CDB team
  • Find out if anything is actionable

millsp avatar Oct 14 '22 14:10 millsp

In a private project we run prisma+CRDB and switched to creating Databases based on their documentation. This didn't result in faster DBs.

We were using db push to init each database but we suspect that db push has a slowness due to how prisma queries the existing schema on the running database (even a fresh database).

davedash avatar Aug 29 '23 16:08 davedash

@davedash That might be related to https://github.com/cockroachdb/cockroach/issues/108781 (or related, we are not sure if we found all of them), which also affects pretty empty databases - but less bad.

janpio avatar Aug 29 '23 17:08 janpio