comparison schema/updates/1409/01.add_fm_validity_indexes.sql @ 4971:de190de05f67 fairway-marks-import

Add index to speed up fairway marks imports a bit The new indexes allow index based filtering of historic entries using the @> operator in the main import SQL statement.
author Tom Gottfried <tom@intevation.de>
date Fri, 28 Feb 2020 18:35:07 +0100
parents
children
comparison
equal deleted inserted replaced
4970:5890e62e6d52 4971:de190de05f67
1 DO LANGUAGE plpgsql
2 $$
3 DECLARE table_suffix varchar;
4 BEGIN
5 FOREACH table_suffix IN ARRAY ARRAY[
6 'bcnlat_hydro', 'bcnlat_ienc', 'boycar',
7 'boylat_hydro', 'boylat_ienc', 'boysaw',
8 'boyspp', 'daymar_hydro', 'daymar_ienc',
9 'lights', 'rtpbcn', 'topmar', 'notmrk']
10 LOOP
11 EXECUTE format(
12 'CREATE INDEX fairway_marks_%1$s_validity '
13 'ON waterway.fairway_marks_%1$s USING GiST (validity)',
14 table_suffix);
15 END LOOP;
16 END;
17 $$;