annotate schema/updates/1409/01.add_fm_validity_indexes.sql @ 5399:47c2ca05e8ec

Merged extented-report branch back into default.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 07 Jul 2021 11:44:40 +0200
parents de190de05f67
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4971
de190de05f67 Add index to speed up fairway marks imports a bit
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
1 DO LANGUAGE plpgsql
de190de05f67 Add index to speed up fairway marks imports a bit
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
2 $$
de190de05f67 Add index to speed up fairway marks imports a bit
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
3 DECLARE table_suffix varchar;
de190de05f67 Add index to speed up fairway marks imports a bit
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
4 BEGIN
de190de05f67 Add index to speed up fairway marks imports a bit
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
5 FOREACH table_suffix IN ARRAY ARRAY[
de190de05f67 Add index to speed up fairway marks imports a bit
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
6 'bcnlat_hydro', 'bcnlat_ienc', 'boycar',
de190de05f67 Add index to speed up fairway marks imports a bit
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
7 'boylat_hydro', 'boylat_ienc', 'boysaw',
de190de05f67 Add index to speed up fairway marks imports a bit
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
8 'boyspp', 'daymar_hydro', 'daymar_ienc',
de190de05f67 Add index to speed up fairway marks imports a bit
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
9 'lights', 'rtpbcn', 'topmar', 'notmrk']
de190de05f67 Add index to speed up fairway marks imports a bit
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
10 LOOP
de190de05f67 Add index to speed up fairway marks imports a bit
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
11 EXECUTE format(
de190de05f67 Add index to speed up fairway marks imports a bit
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
12 'CREATE INDEX fairway_marks_%1$s_validity '
de190de05f67 Add index to speed up fairway marks imports a bit
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
13 'ON waterway.fairway_marks_%1$s USING GiST (validity)',
de190de05f67 Add index to speed up fairway marks imports a bit
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
14 table_suffix);
de190de05f67 Add index to speed up fairway marks imports a bit
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
15 END LOOP;
de190de05f67 Add index to speed up fairway marks imports a bit
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
16 END;
de190de05f67 Add index to speed up fairway marks imports a bit
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
17 $$;