Closed lbesnard closed 2 years ago
There probably should be an index for portal users such as
CREATE INDEX measurement_utc_time_idx ON measurement USING btree (timezone('UTC'::text, "TIME"))
however, the queries I'm running have to be done on "TIME" and not timezone(**) so the creation of the above index probably wouldn't affect me.
I ran in a similar issue with the anmn_ts schema and the measurement table which has the following indexes:
select * from pg_indexes where schemaname = 'anmn_ts' and tablename = 'measurement'
+--------------+-------------+--------------------------+--------------+----------------------------------------------------------------------------------------------------------+
| schemaname | tablename | indexname | tablespace | indexdef |
|--------------+-------------+--------------------------+--------------+----------------------------------------------------------------------------------------------------------|
| anmn_ts | measurement | measurement_utc_time_idx | <null> | CREATE INDEX measurement_utc_time_idx ON anmn_ts.measurement USING btree (timezone('UTC'::text, "TIME")) |
| anmn_ts | measurement | measurement_fk | <null> | CREATE UNIQUE INDEX measurement_fk ON anmn_ts.measurement USING btree (ts_id, index) |
+--------------+-------------+--------------------------+--------------+----------------------------------------------------------------------------------------------------------+
The query I'm currently running has been going on for 20 hours
@lbesnard , would be good to look on the portal if this is really worth doing and is relevant with filtering use cases.
doesn't seem to affect WFS data download
Running queries on the
anmn_nrs_ctd_profiles
using the "TIME" column is really time consuming. This would create some issues for users on the portal. I ran a query which took 12 hours.This shows the definition of the WFS view anmn_nrs_ctd_profiles_data. We can see that this depends on the measurements table:
However, doing a listing of indexes on this table shows that there is no index on "TIME",
This should be fixed in the ANMN_NRS_CTD_PROFILES harvester