You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sqltap is showing that only a single query was performed, when it fact 43 were.
If I set echo=True for sqlalchemy, the relevant output is:
2019-07-01 16:35:48,649 INFO sqlalchemy.engine.base.Engine DELETE FROM master_steps WHERE master_steps.id = %(id)s
2019-07-01 16:35:48,649 INFO sqlalchemy.engine.base.Engine ({'id': 13701}, {'id': 13702}, {'id': 13703}, {'id': 13704}, {'id': 13705}, {'id': 13706}, {'id': 13707}, {'id': 13708} ... displaying 10 of 43 total bound parameter sets ... {'id': 13742}, {'id': 13743})
Turning on postgres logging, we see the actual queries (this was from a different run than the above example with echo=True, so the times and ids are different):
2019-07-01 17:07:34.522 PDT [83440] LOG: statement: DELETE FROM master_steps WHERE master_steps.id = 39873
2019-07-01 17:07:34.540 PDT [83440] LOG: statement: DELETE FROM master_steps WHERE master_steps.id = 39874
... (repeat for all bound parameter sets)
The last bound parameter set is the one being shown in sqltap. Based on the timings from the postgres logs, it looks like the "Total time" shown is the correct value for the sum of all the query times. But the mean, median, max, etc are not correct. And the "Query Count" is not correct.
In case it is helpful, here is what the application code looks like (roughly):
for step in steps:
db_session.delete(step)
# other logic unrelated to steps...
db_session.commit()
The text was updated successfully, but these errors were encountered:
Sqltap is showing that only a single query was performed, when it fact 43 were.
If I set
echo=True
for sqlalchemy, the relevant output is:Turning on postgres logging, we see the actual queries (this was from a different run than the above example with
echo=True
, so the times and ids are different):The last bound parameter set is the one being shown in sqltap. Based on the timings from the postgres logs, it looks like the "Total time" shown is the correct value for the sum of all the query times. But the mean, median, max, etc are not correct. And the "Query Count" is not correct.
In case it is helpful, here is what the application code looks like (roughly):
The text was updated successfully, but these errors were encountered: