CartoDB / observatory-extension

BSD 3-Clause "New" or "Revised" License
6 stars 4 forks source link

Alternative to `OBS_GetMeta` for the `OBS_GetMCDOMVT` function #336

Closed antoniocarlon closed 6 years ago

antoniocarlon commented 6 years ago

Find an alternative to OBS_GetMeta for the OBS_GetMCDOMVT function as it's very expensive when we need a lot of measurements:

gis=# explain analyze
select cdb_observatory.obs_getmeta('0103000020E610000001000000050000000000000000FC52C02C553EA94A6943400000000000FC52C04B37C94C6D7D444000000000004852C04B37C94C6D7D444000000000004852C02C553EA94A6943400000000000FC52C02C553EA94A694340',
'[ {"numer_id":"us.census.acs.B01003001","geom_id":"us.census.tiger.county_clipped"},{"numer_id":"us.census.acs.B01001002","geom_id":"us.census.tiger.county_clipped"},...
                                       QUERY PLAN
-----------------------------------------------------------------------------------------
 Result  (cost=0.00..0.26 rows=1 width=32) (actual time=859.875..859.876 rows=1 loops=1)
 Planning time: 0.028 ms
 Execution time: 859.896 ms

Steps: