-
-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
concurrent query question #1738
Comments
I found a way for postgreSQL to handle concurrent queries, but I couldn't find it for sqlite. Does sqlite not support it? |
Could you please elaborate what you mean? Could you please provide both queries?
sqlite supports concurrent queries. |
The TemplateModel table has a subtable named Property. When querying TemplateModel, I want to query all its subtable data in a related manner.
The query statements are as follows
What parameters are configured to achieve this?Just like the minSize and maxSize added when postgresql connects. |
A single query refers to a non-concurrent call, and the actual query statements are the same |
@luffyxue55 sorry for the confusion, it doesn't seem like parallel queries with sqlite are supported by tortoise ORM.
And tortoise-orm/tortoise/backends/base/client.py Line 235 in 0ddf8d3
|
@henadzit Thanks for your answer. |
I'm not a maintainer of tortoise-orm, I'm just researching the subject and trying to be helpful, so I cannot answer that. A few thoughts from me though:
Could you please talk more about your problem? Are you running into an issue with the database not keeping up with the workload? In general sqlite should be quite fast because it's local. |
Thank you very much anyway. |
Hello,
I have a little problem when I use tortoise-orm query.
I am using fastapi-0.112.0, tortoise-orm-0.21.5, and the database is sqlite3 or postgreSQL.
I have a query interface that uses prefetch_related to associate the query data in the main table and the child table that meet the query
conditions.
Now the front end uses different query conditions to obtain the database data, and the front end requests are concurrent.
At this time, it takes much longer to obtain the query results through the following code than a single query:
Is there any way to optimize it?
The text was updated successfully, but these errors were encountered: