-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add MV to aggregate observations by meshes
Resolve #518
- Loading branch information
Showing
5 changed files
with
79 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
CREATE MATERIALIZED VIEW atlas.vm_observations_meshes_agg AS | ||
SELECT obs.cd_ref, | ||
obs.id_maille AS id_mesh, | ||
obs.annee AS "year", | ||
COUNT(obs.id_observation) AS nbr | ||
FROM atlas.vm_observations_mailles AS obs | ||
GROUP BY obs.cd_ref, obs.id_maille, obs.annee | ||
ORDER BY obs.cd_ref, obs.annee | ||
WITH DATA; | ||
|
||
-- View indexes: | ||
CREATE INDEX idx_voma_annee ON atlas.vm_observations_meshes_agg | ||
USING btree ("year"); | ||
CREATE INDEX idx_voma_id_maille_cd_ref ON atlas.vm_observations_meshes_agg | ||
USING btree (id_mesh, cd_ref); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters