Skip to content

determine "dataset" materialized view refresh rate #5503

Description

@rshewitt

User Story

In order to ensure new catalog records are recent, datagov wants to determine how often (and where) the "dataset" refresh occurs

Acceptance Criteria

[ACs should be clearly demoable/verifiable whenever possible. Try specifying them using BDD.]

  • GIVEN the "dataset" mv
    WHEN a refresh rate is determined and implemented
    THEN "dataset" is updated

Background

  • "dataset" is a materialized view containing the latest set of records (the datasets) for all harvest sources in the h20 db.
  • materialized views need to be refreshed to reflect updates from the underlying query. they do a complete table rewrite.
  • refresh took 2 minutes (see text below) for 141k records. at that time only dcatus records were in the "dataset" mv. we have ~450k records so it could take ~6 minutes total.
[user]=> REFRESH MATERIALIZED VIEW dataset;
NOTICE:  word is too long to be indexed
DETAIL:  Words longer than 2047 characters are ignored.
REFRESH MATERIALIZED VIEW
Time: 123202.888 ms (02:03.203)

Security Considerations (required)

[Any security concerns that might be implicated in the change. "None" is OK, just be explicit here!]

Sketch

  • refresh at end of each harvest (job overlap)
  • cron action
  • run REFRESH MATERIALIZED VIEW [CONCURRENTLY] dataset; on the h20 (read-write) db view. unsure whether configuring the refresh to prevent read-blocking (i.e. concurrently) will have an impact on update pushes to the read-only but it may need to be considered. maybe the nature of the update on the origin db reflects the update on the destination db.

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions