api with pagination, why occur database query with limit 1000 #8523
-
with this api http://127.0.0.1:8123/api/regioninfo/?page=3 ,there are 3 database query show as debug_toolbar:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Make sure that you are running your SQL in the same thread that handled the request. The Django debug toolbar only seems to take a look at the SQL statements that are run in the current thread and assumes that these are the only ones that are related to the request that was handled. |
Beta Was this translation helpful? Give feedback.
-
When you're using the browsable API you may have other database queries that are required in order to generate the form controls. I expect there's a select dropdown on that page, which is rendering a choice of regions to select from. Issuing a request to that endpoint using JSON may not make the same number of queries. |
Beta Was this translation helpful? Give feedback.
When you're using the browsable API you may have other database queries that are required in order to generate the form controls.
I expect there's a select dropdown on that page, which is rendering a choice of regions to select from.
Issuing a request to that endpoint using JSON may not make the same number of queries.