SQLDatabase very slow #18413
Replies: 1 comment 1 reply
-
To improve the performance of the
These strategies can help reduce the overhead of reflecting large database schemas and improve the performance of your application [1]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello. I'm having a very slow time when instantiating a SQLDatabase object (from llama_index.core import SQLDatabase), because the _metadata.reflect method is called inside it.
self._metadata = metadata or MetaData()
# including view support if view_support = true
self._metadata.reflect(
views=view_support,
bind=self._engine,
only=list(self._usable_tables),
schema = self._schema,
)
Since there is a very large table, with several relationships, it is very slow. Is there a way to make the process faster or even persist the metadata that this object generates so that I don't have to do the process all the time?
Beta Was this translation helpful? Give feedback.
All reactions