CWMS-Vue-745: Reimplementing av_location_level and av_virtual_location_level #104
CWMS-Vue-745: Reimplementing av_location_level and av_virtual_location_level #104zack-rma wants to merge 31 commits intoHydrologicEngineeringCenter:mainfrom
Conversation
…ocation_level -splitting av_location_level_ref and av_location_level_values where av_location_level_ref is designed for pagination via CDA and av_location_level_values are decorated by the paginged location_level_codes in the initially filtered av_location_level_ref - units are handled via _EN and _SI columns instead of having additional rows. This matches av_virtual_location_level, but not av_location_level - sorting is not based on fully concatenated location_level_id, but instead of the constituent parts so that full table scan isn't needed prior to sort. no sorting done within the views
|
To quantify the improvement in the view, I compared the execution plans for the level retrieval query from CDA between the original view and the new views. The tested query returned two stored constant level records. When retrieving against the old views, approximately 800kb of temporary space is used. The total CPU cost is 1094, with hundreds of rows being accessed to achieve this result. This view also uses full outer joins. When retrieving against the new views, no temporary space is used. The total CPU cost is 44, with only a few rows being accessed to achieve this result. When run against the NWDP database export containing significantly more rows, the space usage of the original query was recorded using dozens of GB of space to retrieve the results. The new query achieves the same goal using an order of magnitude fewer resources. Query 1: Explain Plan results: New Query: Explain Plan results: |
This reverts commit 87ec5bd.
2cd617b to
a54421e
Compare
This reverts commit a54421e.
…efinition, added grant to test definition.
Continuation of work from #99
Adds tests and documentation
initial performance improvement seen to drop from 90+ seconds for 1000 row retrieval to ~2 seconds for 1000 location level id retrieval (there are actually more than 1000 rows returned because seasonal values are normalized)