Schema in same database -> wrong name -> Use local
Database Subsetter and Relational Data Browser
Brought to you by:
rwisser
Ralf,
(after bumping a superslow insert in MSSQL and having not enough from my admins)
I'm trying to use a combined approach.
Export to "Schema in same database" but have JAILER data local.
But I face strange problem:
On screenshot I typed invalid schema name to cause dear beloved jailer to suggest local option
Anonymous
got this in prompt (as expected)
but then...
Any ideas, maybe I'm missing some point?
I feel this exactly what was designed...
And I feel you have in code the option to select A->B (B.ids) from server and insert it to local database and to have later do select from B where id in (...pass list here...) and put it to "Schema in same database".
(Maybe I'm completely wrong?)
Last edit: Alexander Petrossian (PAF) 2018-11-07
I feel this is some kind of not-designed behaviour.
That "Use local database" is only designed/implemented in local export types, like SQL.
Yes that's true. "local database" is not supported for "schema in same database". (The message is unfortunately misleading). That would make no sense, because this is the most inperformant solution that only makes sense if you have no write permissions on the source database. But you need that for "schema in same database".
Which insert statement was so slow?
The statistics may not be up to date. JAILER_ENTITY is initially empty. If the statistics are not refreshed after some inserts, this can lead to unfavorable query plans.
Is "AUTO_CREATE_STATISTICS" set to "ON"?
Further investigation shows that insert is OK.
Yes, it is all about statistics.
Yesterday some magic happened (statistics got somehow updated) and execution plans turned to bright side and decided to use parallelism.
I'm not yet up on MSSQL statistics and am bugging Customer's DBA about it.
Thanks, Ralf.
The statistics can also be updated by the tool during the export.
For this purpose, the file "script /mssql/update_statistics.sql" (for MSSQL) is regularly executed.
The "UPDATE STATISTICS" statements have just been added to the file and checked in.
Important: to activate this feature, you must rebuild the project with ant after the checkout.