You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
While creating cockroachdb instance via WithInstance(). Checks are made to ensure that version & Lock tables are created.
These two function tap into information_schema.tables. Which is an expensive query. ~15 Sec each.
query:=`SELECT COUNT(1) FROM information_schema.tables WHERE table_name = $1 AND table_schema = (SELECT current_schema()) LIMIT 1`
Describe the solution you'd like
Ideas :
Let the user pass-on the query string for both the functions.
Introduce another field ValidateTables to Config
type Config struct {
MigrationsTable string
LockTable string
ForceLock bool
DatabaseName string
// this will the new field, for users to Enable/Disable validations.
ValidateTables bool
}
Additional context
If we skip this validation the migration which takes ~30 Secs is reduced to < 1Sec
The text was updated successfully, but these errors were encountered:
deepakd10
changed the title
Allow users to overwrite ensureVersionTable & ensureLockTable
Expensive SQL query inside ensureVersionTable & ensureLockTable
Mar 13, 2024
Is your feature request related to a problem? Please describe.
While creating
cockroachdb
instance viaWithInstance()
. Checks are made to ensure that version & Lock tables are created.These two function tap into
information_schema.tables
. Which is an expensive query.~15 Sec
each.withinstance() function location ->
migrate/database/cockroachdb/cockroachdb.go
Line 350 in cd17c5a
ensureLockTable() function location ->
migrate/database/cockroachdb/cockroachdb.go
Line 350 in cd17c5a
ensureVersionTable() function location ->
migrate/database/cockroachdb/cockroachdb.go
Line 331 in cd17c5a
Describe the solution you'd like
Ideas :
ValidateTables
toConfig
Additional context
If we skip this validation the migration which takes
~30 Secs
is reduced to <1Sec
The text was updated successfully, but these errors were encountered: