Closed raftmsohani closed 3 weeks ago
As part of this spike, I investigated the timing of admin page tables, which uses boilerplate django settings to query models and show them in tables.
With models that include more columns, even if we uselist_display
to limit columns in the table, django still queries all columns and filters listing columns after the query is done.
As an example, for Parser Error
model, we are setting:
list_display = [
'row_number',
'field_name',
'error_type',
'error_message',
]
which is intended to limit the display columns to four listed columns, but the ParserError model has 15 columns. Additionally, one of the fields is JSON field, which generally takes more time to query.
By changing the query set, I could limit the fields in the query to the ones listed for display. This improved the query time by 10-15%.
With data in DB to start growing, we will need to start looking into improving efficiency of querysets using methods descrbed in here
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 90.66%. Comparing base (
265d196
) to head (71ce3c7
). Report is 24 commits behind head on develop.
Summary of Changes
Provide a brief summary of changes Pull request closes #3075 _
How to Test
List the steps to test the PR These steps are generic, please adjust as necessary.
Deliverables
More details on how deliverables herein are assessed included here.
Deliverable 1: Accepted Features
Checklist of ACs:
lfrohlich
and/oradpennington
confirmed that ACs are met.Deliverable 2: Tested Code
CodeCov Report
comment in PR)CodeCov Report
comment in PR)Deliverable 3: Properly Styled Code
Deliverable 4: Accessible
iamjolly
andttran-hub
using Accessibility Insights reveal any errors introduced in this PR?Deliverable 5: Deployed
Deliverable 6: Documented
Deliverable 7: Secure
Deliverable 8: User Research
Research product(s) clearly articulate(s):