#1 2020-01-10 07:41:20

cutec-chris
Member
Registered: 2020-01-09
Posts: 6

CreateMissingTables on an Model with a lot of external Tables

Ive noticed that CreateMissingTables on external Tables is pretty slow when the Model is quite Big.
Is there an prefered way to work around that ?
At example by defining more models and loading them when needed or something like that ?

When i understand it right, thats basically becouse mormot fires an select to any registered table (to get Field names?)
Maybe its possible to do that asynchronious later or something like that ?

Offline

#2 2020-01-10 09:31:53

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,258
Website

Re: CreateMissingTables on an Model with a lot of external Tables

I never encountered this problem, but I didn't use huge models with external databases, and rather use SQLite3 with a few tables.

There is no asynch/delayed way.
But you can try to set the rpmNoCreateMissingTable, rpmNoCreateMissingField options when registering the external tables, unless you know that the model changed - e.g. after a setup, you just set a flag to in the application settings.

Edit: after more investigation, I guess GetFields is always called in TSQLRestStorageExternal.Create, since we need the actual DB fields raw information for proper process...
If GetFields is the culprit of being slow, you wouldn't make it faster.
Could you try to debug and benchmark which method takes time in your configuration.
Or at least enable verbose logs and check the timestamps, which will give information about the timing in TSQLRestStorageExternal.Create.

Offline

Board footer

Powered by FluxBB