New test statistics API endpoint needs optimizing for number of database hits:
Ref: #7164
API / database queries should be annotated to prevent duplicate queries
InvenTree-Version: 0.16.0 dev
Django Version: 4.2.14
Commit Hash: c2c66c5
Commit Date: 2024-07-31
Commit Branch: build-test-results
Database: postgresql
Debug-Mode: True
Deployed using Docker: True
Platform: Linux-5.15.133.1-microsoft-standard-WSL2-x86_64-with
Installer: DOC
Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.1.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}, {'name': 'InvenTreeCurrencyExchange', 'slug': 'inventreecurrencyexchange', 'version': '1.0.0'}, {'name': 'InvenTreeLabel', 'slug': 'inventreelabel', 'version': '1.1.0'}, {'name': 'InvenTreeLabelMachine', 'slug': 'inventreelabelmachine', 'version': '1.0.0'}, {'name': 'InvenTreeLabelSheet', 'slug': 'inventreelabelsheet', 'version': '1.0.0'}, {'name': 'DigiKeyPlugin', 'slug': 'digikeyplugin', 'version': '1.0.0'}, {'name': 'LCSCPlugin', 'slug': 'lcscplugin', 'version': '1.0.0'}, {'name': 'MouserPlugin', 'slug': 'mouserplugin', 'version': '1.0.0'}, {'name': 'TMEPlugin', 'slug': 'tmeplugin', 'version': '1.0.0'}]
http://localhost:8000/api/test-statistics/by-build/1/
|------|-----------|----------|----------|----------|------------|
| Type | Database | Reads | Writes | Totals | Duplicates |
|------|-----------|----------|----------|----------|------------|
| REQU | default | 1 | 0 | 1 | 0 |
|------|-----------|----------|----------|----------|------------|
| RESP | default | 129 | 0 | 129 | 122 |
|------|-----------|----------|----------|----------|------------|
Total queries: 130 in 0.1329s
Executed 60 time(s).
SELECT COUNT(*) AS "__count" FROM "stock_stockitemtestresult" WHERE
("stock_stockitemtestresult"."stock_item_id" = #number# AND
"stock_stockitemtestresult"."template_id" = #number# AND
"stock_stockitemtestresult"."result")
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too