Find answers from the community

Updated 3 months ago

Any ideas on how to speed up the load

Any ideas on how to speed up the load time for index creation for SQL Database. It seems as though it takes a lot of time for it to do this at query, which is not optimal. Is it possible to do it before hand?

It seems very naive I'm doing this, I guess I should pre-index it and load it up on inference. Any ideas how much this will reduce inference time?
Attachment
Screenshot_2023-07-02_at_7.47.50_AM.png
L
H
8 comments
Yea I've noticed that the slow part seems to be the SQLDatabase() constructor, at least the last time I checked

If you can load this once at startup, that would be ideal πŸ™‚
No idea how to speed it up though. Under the hood its not doing anything crazy πŸ€”
I made it persist with s3, but not sure why its not storing everything about that index?
Attachment
Screenshot_2023-07-02_at_9.20.30_AM.png
Is it supposed to be this way? It's asking me to define a SQL database again, not sure why. Looking at the files stored to s3, it seems not much info is persisted for it to reconstruct the index such as connection string, table name, etc.
I can try doing that, but first I'm seeing if persisting it helps.
Persisting a sql index doesn't actually do anything. Because all the data is in the sql database right? and you need the connection to the db to run anything. So yea it's intended to just be initialized when you need it

(and actually, the sql index is slightly deprecated in favor of just the query engine)
https://gpt-index.readthedocs.io/en/latest/guides/tutorials/sql_guide.html
NIce. NLSQLTableQueryEngine didn't see that before.
I'll move the initialization of SQLDatabase to startup and directly use NLSQLTableQueryEngine. Neat.
Add a reply
Sign up and join the conversation on Discord