Closed wolflu05 closed 1 year ago
@wolflu05 nice find, certainly seems like a major performance hit. It will be interesting to see where these are coming from. Do you have any idea about the source of these duplicate queries?
No, no idea, haven't investigated further, just found that these queries are made. Maybe they are somehow related to Django. At least the first 400. @matmair do you have seen this before in one of your Django apps?
@wolflu05 I'd suggest you check this again on your end with the latest code. The linked issues should have addressed a lot of this, I think
Those 400+ django queries are now gone, but the logs still show a bunch of sql queries that look like the n+1 issue. But good work. Do you know what exactly caused those django queries, that looked similar to this one? These seem to be gone now.
(0.001) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."id" = 79 LIMIT 21; args=(79,)
A lot of improvements was made in this PR
Not sure what is going on with the currency setting - that is getting called a lot of times!
So, at least for the INVENTREE_DEFAULT_CURRENCY
field, here's what is happening:
The currency_code_default()
method is getting called dozens of times during server start. This is for two main reasons:
So, the value of this function is being evaluated lots of times in quick succession. As the database is not ready (not yet loaded) and the value is not cached, then we are performing lots of database hits.
We should re-think how this function is implemented, so that we either don't need any database hits when initially loading the application, or we can develop some better caching strategy.
With the linked PRs, this is now pretty good. DB hits have been significantly reduced on server start
Thanks for improving this a lot. I collected all prs that are linked to this issue in a tasklist in the initial description.
Please verify that this feature request has NOT been suggested before.
Problem statement
While developing #5561 I tried to make sure that it doesn't impact performance so I enabled SQL logging by adding the following to the settings:
StockItemManager
which seems like it is not referenced anywhere so its dead code. This manager needs to be tested if the prefetch works correctly and then attached to theStockItem
.Startup logs:
``` (0.001) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."id" = 79 LIMIT 21; args=(79,) [~100 more rows] [~100 more rows] [~100 more rows] [~100 more rows] (0.000) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."id" = 56 LIMIT 21; args=(56,) (0.000) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."id" = 56 LIMIT 21; args=(56,) (0.000) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."id" = 55 LIMIT 21; args=(55,) (0.000) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."id" = 55 LIMIT 21; args=(55,) (0.000) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."id" = 55 LIMIT 21; args=(55,) (0.001) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."id" = 55 LIMIT 21; args=(55,) (0.001) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."id" = 52 LIMIT 21; args=(52,) (0.005) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."id" = 52 LIMIT 21; args=(52,) (0.001) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."id" = 52 LIMIT 21; args=(52,) (0.001) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."id" = 52 LIMIT 21; args=(52,) (0.000) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."id" = 101 LIMIT 21; args=(101,) (0.000) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."id" = 102 LIMIT 21; args=(102,) (0.001) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."id" = 57 LIMIT 21; args=(57,) (0.001) SELECT "users_ruleset"."id", "users_ruleset"."name", "users_ruleset"."group_id", "users_ruleset"."can_view", "users_ruleset"."can_add", "users_ruleset"."can_change", "users_ruleset"."can_delete" FROM "users_ruleset" WHERE ("users_ruleset"."group_id" = 3 AND "users_ruleset"."name" = 'admin') LIMIT 21; args=(3, 'admin') (0.000) SELECT "users_ruleset"."id", "users_ruleset"."name", "users_ruleset"."group_id", "users_ruleset"."can_view", "users_ruleset"."can_add", "users_ruleset"."can_change", "users_ruleset"."can_delete" FROM "users_ruleset" WHERE ("users_ruleset"."group_id" = 3 AND "users_ruleset"."name" = 'part_category') LIMIT 21; args=(3, 'part_category') (0.001) SELECT "users_ruleset"."id", "users_ruleset"."name", "users_ruleset"."group_id", "users_ruleset"."can_view", "users_ruleset"."can_add", "users_ruleset"."can_change", "users_ruleset"."can_delete" FROM "users_ruleset" WHERE ("users_ruleset"."group_id" = 3 AND "users_ruleset"."name" = 'part') LIMIT 21; args=(3, 'part') (0.001) SELECT "users_ruleset"."id", "users_ruleset"."name", "users_ruleset"."group_id", "users_ruleset"."can_view", "users_ruleset"."can_add", "users_ruleset"."can_change", "users_ruleset"."can_delete" FROM "users_ruleset" WHERE ("users_ruleset"."group_id" = 3 AND "users_ruleset"."name" = 'stocktake') LIMIT 21; args=(3, 'stocktake') (0.001) SELECT "users_ruleset"."id", "users_ruleset"."name", "users_ruleset"."group_id", "users_ruleset"."can_view", "users_ruleset"."can_add", "users_ruleset"."can_change", "users_ruleset"."can_delete" FROM "users_ruleset" WHERE ("users_ruleset"."group_id" = 3 AND "users_ruleset"."name" = 'stock_location') LIMIT 21; args=(3, 'stock_location') (0.001) SELECT "users_ruleset"."id", "users_ruleset"."name", "users_ruleset"."group_id", "users_ruleset"."can_view", "users_ruleset"."can_add", "users_ruleset"."can_change", "users_ruleset"."can_delete" FROM "users_ruleset" WHERE ("users_ruleset"."group_id" = 3 AND "users_ruleset"."name" = 'stock') LIMIT 21; args=(3, 'stock') (0.001) SELECT "users_ruleset"."id", "users_ruleset"."name", "users_ruleset"."group_id", "users_ruleset"."can_view", "users_ruleset"."can_add", "users_ruleset"."can_change", "users_ruleset"."can_delete" FROM "users_ruleset" WHERE ("users_ruleset"."group_id" = 3 AND "users_ruleset"."name" = 'build') LIMIT 21; args=(3, 'build') (0.001) SELECT "users_ruleset"."id", "users_ruleset"."name", "users_ruleset"."group_id", "users_ruleset"."can_view", "users_ruleset"."can_add", "users_ruleset"."can_change", "users_ruleset"."can_delete" FROM "users_ruleset" WHERE ("users_ruleset"."group_id" = 3 AND "users_ruleset"."name" = 'purchase_order') LIMIT 21; args=(3, 'purchase_order') (0.001) SELECT "users_ruleset"."id", "users_ruleset"."name", "users_ruleset"."group_id", "users_ruleset"."can_view", "users_ruleset"."can_add", "users_ruleset"."can_change", "users_ruleset"."can_delete" FROM "users_ruleset" WHERE ("users_ruleset"."group_id" = 3 AND "users_ruleset"."name" = 'sales_order') LIMIT 21; args=(3, 'sales_order') (0.001) SELECT "users_ruleset"."id", "users_ruleset"."name", "users_ruleset"."group_id", "users_ruleset"."can_view", "users_ruleset"."can_add", "users_ruleset"."can_change", "users_ruleset"."can_delete" FROM "users_ruleset" WHERE ("users_ruleset"."group_id" = 3 AND "users_ruleset"."name" = 'return_order') LIMIT 21; args=(3, 'return_order') (0.001) SELECT "auth_group"."id", "auth_group"."name" FROM "auth_group"; args=() (0.001) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'auth' AND "django_content_type"."model" = 'group') LIMIT 21; args=('auth', 'group') (0.001) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'auth' AND "django_content_type"."model" = 'user') LIMIT 21; args=('auth', 'user') (0.001) SELECT "users_owner"."id", "users_owner"."owner_type_id", "users_owner"."owner_id" FROM "users_owner" WHERE ("users_owner"."owner_id" = 1 AND "users_owner"."owner_type_id" = 64) LIMIT 21; args=(1, 64) (0.001) SELECT "users_owner"."id", "users_owner"."owner_type_id", "users_owner"."owner_id" FROM "users_owner" WHERE ("users_owner"."owner_id" = 2 AND "users_owner"."owner_type_id" = 64) LIMIT 21; args=(2, 64) (0.001) SELECT "users_owner"."id", "users_owner"."owner_type_id", "users_owner"."owner_id" FROM "users_owner" WHERE ("users_owner"."owner_id" = 3 AND "users_owner"."owner_type_id" = 64) LIMIT 21; args=(3, 64) (0.003) SELECT "auth_user"."id", "auth_user"."password", "auth_user"."last_login", "auth_user"."is_superuser", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"."date_joined" FROM "auth_user"; args=() (0.001) SELECT "users_owner"."id", "users_owner"."owner_type_id", "users_owner"."owner_id" FROM "users_owner" WHERE ("users_owner"."owner_id" = 1 AND "users_owner"."owner_type_id" = 65) LIMIT 21; args=(1, 65) (0.001) SELECT "users_owner"."id", "users_owner"."owner_type_id", "users_owner"."owner_id" FROM "users_owner" WHERE ("users_owner"."owner_id" = 2 AND "users_owner"."owner_type_id" = 65) LIMIT 21; args=(2, 65) (0.000) SELECT "users_owner"."id", "users_owner"."owner_type_id", "users_owner"."owner_id" FROM "users_owner" WHERE ("users_owner"."owner_id" = 3 AND "users_owner"."owner_type_id" = 65) LIMIT 21; args=(3, 65) (0.000) SELECT "users_owner"."id", "users_owner"."owner_type_id", "users_owner"."owner_id" FROM "users_owner" WHERE ("users_owner"."owner_id" = 4 AND "users_owner"."owner_type_id" = 65) LIMIT 21; args=(4, 65) (0.001) SELECT "users_owner"."id", "users_owner"."owner_type_id", "users_owner"."owner_id" FROM "users_owner" WHERE ("users_owner"."owner_id" = 5 AND "users_owner"."owner_type_id" = 65) LIMIT 21; args=(5, 65) (0.001) SELECT "users_owner"."id", "users_owner"."owner_type_id", "users_owner"."owner_id" FROM "users_owner" WHERE ("users_owner"."owner_id" = 6 AND "users_owner"."owner_type_id" = 65) LIMIT 21; args=(6, 65) (0.001) SELECT "users_owner"."id", "users_owner"."owner_type_id", "users_owner"."owner_id" FROM "users_owner" WHERE ("users_owner"."owner_id" = 8 AND "users_owner"."owner_type_id" = 65) LIMIT 21; args=(8, 65) (0.001) SELECT "users_owner"."id", "users_owner"."owner_type_id", "users_owner"."owner_id" FROM "users_owner" WHERE ("users_owner"."owner_id" = 9 AND "users_owner"."owner_type_id" = 65) LIMIT 21; args=(9, 65) (0.001) SELECT "django_q_schedule"."id", "django_q_schedule"."name", "django_q_schedule"."func", "django_q_schedule"."hook", "django_q_schedule"."args", "django_q_schedule"."kwargs", "django_q_schedule"."schedule_type", "django_q_schedule"."minutes", "django_q_schedule"."repeats", "django_q_schedule"."next_run", "django_q_schedule"."cron", "django_q_schedule"."task", "django_q_schedule"."cluster", "django_q_schedule"."intended_date_kwarg" FROM "django_q_schedule" WHERE "django_q_schedule"."func" IN ('InvenTree.tasks.delete_expired_sessions', 'stock.tasks.delete_old_stock_items'); args=('InvenTree.tasks.delete_expired_sessions', 'stock.tasks.delete_old_stock_items') (0.001) BEGIN; args=None (0.001) SELECT (1) AS "a" FROM "django_q_schedule" WHERE "django_q_schedule"."func" = 'InvenTree.tasks.heartbeat' LIMIT 1; args=('InvenTree.tasks.heartbeat',) (0.001) UPDATE "django_q_schedule" SET "schedule_type" = 'I', "minutes" = 5, "repeats" = -1 WHERE "django_q_schedule"."func" = 'InvenTree.tasks.heartbeat'; args=('I', 5, -1, 'InvenTree.tasks.heartbeat') (0.000) SELECT (1) AS "a" FROM "django_q_schedule" WHERE "django_q_schedule"."func" = 'InvenTree.tasks.delete_successful_tasks' LIMIT 1; args=('InvenTree.tasks.delete_successful_tasks',) (0.001) UPDATE "django_q_schedule" SET "schedule_type" = 'D', "minutes" = NULL, "repeats" = -1 WHERE "django_q_schedule"."func" = 'InvenTree.tasks.delete_successful_tasks'; args=('D', -1, 'InvenTree.tasks.delete_successful_tasks') (0.000) SELECT (1) AS "a" FROM "django_q_schedule" WHERE "django_q_schedule"."func" = 'InvenTree.tasks.delete_failed_tasks' LIMIT 1; args=('InvenTree.tasks.delete_failed_tasks',) (0.001) UPDATE "django_q_schedule" SET "schedule_type" = 'D', "minutes" = NULL, "repeats" = -1 WHERE "django_q_schedule"."func" = 'InvenTree.tasks.delete_failed_tasks'; args=('D', -1, 'InvenTree.tasks.delete_failed_tasks') (0.001) SELECT (1) AS "a" FROM "django_q_schedule" WHERE "django_q_schedule"."func" = 'InvenTree.tasks.delete_old_error_logs' LIMIT 1; args=('InvenTree.tasks.delete_old_error_logs',) (0.000) UPDATE "django_q_schedule" SET "schedule_type" = 'D', "minutes" = NULL, "repeats" = -1 WHERE "django_q_schedule"."func" = 'InvenTree.tasks.delete_old_error_logs'; args=('D', -1, 'InvenTree.tasks.delete_old_error_logs') (0.001) SELECT (1) AS "a" FROM "django_q_schedule" WHERE "django_q_schedule"."func" = 'InvenTree.tasks.delete_old_notifications' LIMIT 1; args=('InvenTree.tasks.delete_old_notifications',) (0.000) UPDATE "django_q_schedule" SET "schedule_type" = 'D', "minutes" = NULL, "repeats" = -1 WHERE "django_q_schedule"."func" = 'InvenTree.tasks.delete_old_notifications'; args=('D', -1, 'InvenTree.tasks.delete_old_notifications') (0.000) SELECT (1) AS "a" FROM "django_q_schedule" WHERE "django_q_schedule"."func" = 'InvenTree.tasks.check_for_updates' LIMIT 1; args=('InvenTree.tasks.check_for_updates',) (0.000) UPDATE "django_q_schedule" SET "schedule_type" = 'D', "minutes" = NULL, "repeats" = -1 WHERE "django_q_schedule"."func" = 'InvenTree.tasks.check_for_updates'; args=('D', -1, 'InvenTree.tasks.check_for_updates') (0.000) SELECT (1) AS "a" FROM "django_q_schedule" WHERE "django_q_schedule"."func" = 'InvenTree.tasks.update_exchange_rates' LIMIT 1; args=('InvenTree.tasks.update_exchange_rates',) (0.001) UPDATE "django_q_schedule" SET "schedule_type" = 'D', "minutes" = NULL, "repeats" = -1 WHERE "django_q_schedule"."func" = 'InvenTree.tasks.update_exchange_rates'; args=('D', -1, 'InvenTree.tasks.update_exchange_rates') (0.000) SELECT (1) AS "a" FROM "django_q_schedule" WHERE "django_q_schedule"."func" = 'InvenTree.tasks.run_backup' LIMIT 1; args=('InvenTree.tasks.run_backup',) (0.000) UPDATE "django_q_schedule" SET "schedule_type" = 'D', "minutes" = NULL, "repeats" = -1 WHERE "django_q_schedule"."func" = 'InvenTree.tasks.run_backup'; args=('D', -1, 'InvenTree.tasks.run_backup') (0.000) SELECT (1) AS "a" FROM "django_q_schedule" WHERE "django_q_schedule"."func" = 'InvenTree.tasks.check_for_migrations' LIMIT 1; args=('InvenTree.tasks.check_for_migrations',) (0.001) UPDATE "django_q_schedule" SET "schedule_type" = 'D', "minutes" = NULL, "repeats" = -1 WHERE "django_q_schedule"."func" = 'InvenTree.tasks.check_for_migrations'; args=('D', -1, 'InvenTree.tasks.check_for_migrations') (0.000) SELECT (1) AS "a" FROM "django_q_schedule" WHERE "django_q_schedule"."func" = 'part.tasks.check_missing_pricing' LIMIT 1; args=('part.tasks.check_missing_pricing',) (0.000) UPDATE "django_q_schedule" SET "schedule_type" = 'D', "minutes" = NULL, "repeats" = -1 WHERE "django_q_schedule"."func" = 'part.tasks.check_missing_pricing'; args=('D', -1, 'part.tasks.check_missing_pricing') (0.001) SELECT (1) AS "a" FROM "django_q_schedule" WHERE "django_q_schedule"."func" = 'part.tasks.scheduled_stocktake_reports' LIMIT 1; args=('part.tasks.scheduled_stocktake_reports',) (0.001) UPDATE "django_q_schedule" SET "schedule_type" = 'D', "minutes" = NULL, "repeats" = -1 WHERE "django_q_schedule"."func" = 'part.tasks.scheduled_stocktake_reports'; args=('D', -1, 'part.tasks.scheduled_stocktake_reports') (0.001) SELECT (1) AS "a" FROM "django_q_schedule" WHERE "django_q_schedule"."func" = 'build.tasks.check_overdue_build_orders' LIMIT 1; args=('build.tasks.check_overdue_build_orders',) (0.001) UPDATE "django_q_schedule" SET "schedule_type" = 'D', "minutes" = NULL, "repeats" = -1 WHERE "django_q_schedule"."func" = 'build.tasks.check_overdue_build_orders'; args=('D', -1, 'build.tasks.check_overdue_build_orders') (0.001) SELECT (1) AS "a" FROM "django_q_schedule" WHERE "django_q_schedule"."func" = 'common.tasks.delete_old_notifications' LIMIT 1; args=('common.tasks.delete_old_notifications',) (0.001) UPDATE "django_q_schedule" SET "schedule_type" = 'D', "minutes" = NULL, "repeats" = -1 WHERE "django_q_schedule"."func" = 'common.tasks.delete_old_notifications'; args=('D', -1, 'common.tasks.delete_old_notifications') (0.001) SELECT (1) AS "a" FROM "django_q_schedule" WHERE "django_q_schedule"."func" = 'common.tasks.update_news_feed' LIMIT 1; args=('common.tasks.update_news_feed',) (0.000) UPDATE "django_q_schedule" SET "schedule_type" = 'D', "minutes" = NULL, "repeats" = -1 WHERE "django_q_schedule"."func" = 'common.tasks.update_news_feed'; args=('D', -1, 'common.tasks.update_news_feed') (0.001) SELECT (1) AS "a" FROM "django_q_schedule" WHERE "django_q_schedule"."func" = 'common.tasks.delete_old_notes_images' LIMIT 1; args=('common.tasks.delete_old_notes_images',) (0.000) UPDATE "django_q_schedule" SET "schedule_type" = 'D', "minutes" = NULL, "repeats" = -1 WHERE "django_q_schedule"."func" = 'common.tasks.delete_old_notes_images'; args=('D', -1, 'common.tasks.delete_old_notes_images') (0.001) SELECT (1) AS "a" FROM "django_q_schedule" WHERE "django_q_schedule"."func" = 'label.tasks.cleanup_old_label_outputs' LIMIT 1; args=('label.tasks.cleanup_old_label_outputs',) (0.001) UPDATE "django_q_schedule" SET "schedule_type" = 'D', "minutes" = NULL, "repeats" = -1 WHERE "django_q_schedule"."func" = 'label.tasks.cleanup_old_label_outputs'; args=('D', -1, 'label.tasks.cleanup_old_label_outputs') (0.001) SELECT (1) AS "a" FROM "django_q_schedule" WHERE "django_q_schedule"."func" = 'order.tasks.check_overdue_purchase_orders' LIMIT 1; args=('order.tasks.check_overdue_purchase_orders',) (0.000) UPDATE "django_q_schedule" SET "schedule_type" = 'D', "minutes" = NULL, "repeats" = -1 WHERE "django_q_schedule"."func" = 'order.tasks.check_overdue_purchase_orders'; args=('D', -1, 'order.tasks.check_overdue_purchase_orders') (0.000) SELECT (1) AS "a" FROM "django_q_schedule" WHERE "django_q_schedule"."func" = 'order.tasks.check_overdue_sales_orders' LIMIT 1; args=('order.tasks.check_overdue_sales_orders',) (0.001) UPDATE "django_q_schedule" SET "schedule_type" = 'D', "minutes" = NULL, "repeats" = -1 WHERE "django_q_schedule"."func" = 'order.tasks.check_overdue_sales_orders'; args=('D', -1, 'order.tasks.check_overdue_sales_orders') (0.017) INSERT INTO "django_q_ormq" ("key", "payload", "lock") VALUES ('InvenTree', 'gAWV1gAAAAAAAAB9lCiMAmlklIwgYWQ1N2VjODFhZWI4NDA3ZTllYmM5MzYyMmFmNGQ2NzeUjARuYW1llIwfbmVicmFza2EtY29sYS1zdGFpcndheS1tYWdhemluZZSMBGZ1bmOUjA9JbnZlblRyZWUudGFza3OUjAloZWFydGJlYXSUk5SMBGFyZ3OUKYwGa3dhcmdzlH2UjAdzdGFydGVklIwIZGF0ZXRpbWWUjAhkYXRldGltZZSTlEMKB-cJFQkCCANXaZSMBHB5dHqUjARfVVRDlJOUKVKUhpRSlHUu:1qjFZY:Osoy1NZ5rAXmQdMhLRvTxkRHGCcKot3SNyTwgnFRj3E', '2023-09-21 09:02:08.220733'); args=['InvenTree', 'gAWV1gAAAAAAAAB9lCiMAmlklIwgYWQ1N2VjODFhZWI4NDA3ZTllYmM5MzYyMmFmNGQ2NzeUjARuYW1llIwfbmVicmFza2EtY29sYS1zdGFpcndheS1tYWdhemluZZSMBGZ1bmOUjA9JbnZlblRyZWUudGFza3OUjAloZWFydGJlYXSUk5SMBGFyZ3OUKYwGa3dhcmdzlH2UjAdzdGFydGVklIwIZGF0ZXRpbWWUjAhkYXRldGltZZSTlEMKB-cJFQkCCANXaZSMBHB5dHqUjARfVVRDlJOUKVKUhpRSlHUu:1qjFZY:Osoy1NZ5rAXmQdMhLRvTxkRHGCcKot3SNyTwgnFRj3E', '2023-09-21 09:02:08.220733'] (0.000) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',) (0.001) SELECT (1) AS "a" FROM "exchange_exchangebackend" WHERE "exchange_exchangebackend"."name" = 'InvenTreeExchange' LIMIT 1; args=('InvenTreeExchange',) (0.007) SELECT "exchange_exchangebackend"."name", "exchange_exchangebackend"."last_update", "exchange_exchangebackend"."base_currency" FROM "exchange_exchangebackend" WHERE "exchange_exchangebackend"."name" = 'InvenTreeExchange' ORDER BY "exchange_exchangebackend"."name" ASC LIMIT 1; args=('InvenTreeExchange',) (0.001) SELECT "common_customunit"."id", "common_customunit"."name", "common_customunit"."symbol", "common_customunit"."definition" FROM "common_customunit"; args=() Redefining 'Ohm' ()
Watching for file changes with StatReloader
Watching for file changes with StatReloader
Performing system checks...
(0.010) SELECT "flags_flagstate"."id", "flags_flagstate"."name", "flags_flagstate"."condition", "flags_flagstate"."value", "flags_flagstate"."required" FROM "flags_flagstate"; args=()
System check identified no issues (1 silenced).
(0.002) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.000) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.000) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.000) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.000) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.000) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.000) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.000) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.000) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.000) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.000) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.000) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.000) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.000) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.000) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.000) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.000) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.000) SELECT "common_inventreesetting"."id", "common_inventreesetting"."value", "common_inventreesetting"."key" FROM "common_inventreesetting" WHERE "common_inventreesetting"."key" LIKE 'INVENTREE\_DEFAULT\_CURRENCY' ESCAPE '\' ORDER BY "common_inventreesetting"."id" ASC LIMIT 1; args=('INVENTREE\\_DEFAULT\\_CURRENCY',)
(0.001)
SELECT name, type FROM sqlite_master
WHERE type in ('table', 'view') AND NOT name='sqlite_sequence'
ORDER BY name; args=None
(0.002) SELECT "django_migrations"."id", "django_migrations"."app", "django_migrations"."name", "django_migrations"."applied" FROM "django_migrations"; args=()
September 21, 2023 - 09:02:44
Django version 3.2.20, using settings 'InvenTree.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
```
Suggested solution
Try to combine the queries with
__in=[1,3,4,5]
or lte, gte .Describe alternatives you've considered
-
Examples of other systems
No response
Do you want to develop this?