Skip to content

initial concept for reimplementing av_location_level and av_virtual_location_level#99

Draft
adamkorynta wants to merge 1 commit intomainfrom
feature/loc_lvl_optimization
Draft

initial concept for reimplementing av_location_level and av_virtual_location_level#99
adamkorynta wants to merge 1 commit intomainfrom
feature/loc_lvl_optimization

Conversation

@adamkorynta
Copy link
Contributor

  • 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

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)

…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
Copy link
Contributor

@MikeNeilson MikeNeilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite the improvement.

create or replace public synonym cwms_v_location_level_values for av_location_level_values;
SELECT *
FROM av_location_level_values
WHERE ROWNUM <= 10; No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the rownum here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover spot check, should have been in the scratch_file.sql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants