I use pg-promise to query a postgis database containing rasters. Queries are strings (with no parameters) generated before being processed by pg-promise.
The duration time of one query is typically 140ms (given by result function), while only 15ms in psql.
Example:
SELECT ST_Value(t_2m_1, ST_SetSrid(ST_MakePoint(5,50),4326)) AS t_2m_1 FROM iconeu_001 WHERE ST_Intersects(t_2m_1,ST_SetSrid(ST_MakePoint(5,50),4326));
Results: [ { t_2m_1: 4.61391601562502 } ] Duration: 147ms
While timing in psql:
t_2m_1
------------------
4.61391601562502
(1 row)
Time: 15.828 ms
It means that 90% of time is spent by pre and post processing the query as explained here.
Also, is there any way of dramatically speed up this steps (by skipping some unneeded steps for instance) ??
Thanks in advance.
PS: congratulations to vitaly-t for this excellent module !