Skip to content
Discussion options

You must be logged in to vote

Generally speaking, yes. The SQLDatabaseChain will still work if you have a really large database. SQLDatabaseChain doesn't load the entire database into memory. Instead, it formulates a SQL query based on your input and then runs it against the database. The only time you may run into issues is if the SQL query result is too long and exceeds the prompt token limit for your chosen LLM. For example, davinci has a limit of about 4,000 tokens.

If you're using the SQL Database Agent (rather than the chain), be aware that it will start with listing all the tables in the db. This can also potentially cause problems if the number of tables is too large and exceeds the prompt token limit.

Hope th…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@nthanhtin
Comment options

@naman-gupta99
Comment options

@ghost
Comment options

@starball5
Comment options

Answer selected by nthanhtin
Comment options

You must be logged in to vote
2 replies
@alanwilhelm
Comment options

@usersina
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants