Hi,
thanks for advice. CTE looks like the solution for me. I did not measure
any performance but it is obviously better than test each point in a loop.
M
On 06/13/2016 08:46 PM, Leknín Řepánek wrote:
Python Array -> geometry(POINT, [SRID])[] -> unnest, you can use unnest
in CTE
something
On 6/14/2016 3:53 AM, Michal Seidl wrote:
With other operators ST_Distance,ST_Equal, = the spatial index is not
used (?) and query take about 500ms. 500 points x 500ms => 250s which
is quite a lot and I do not take into account time spent on python
side. That's the problem.
Do everything in
Index not used can have a lot of causes:
1. the way you write the sql query,
2. a problem with statistics (vacuum analyze concerned tables)
3. a wrong tuning of postgres server (less common)
...
Most likely in your case is 1., but you can vacuum analyze the tables
first, it could be an easy fix.
Hello,
You understand my problem correctly. But despite I have sptatial index
on geometry colum (points are 2D) one SQL query takes about 20ms only
with operator && ST_GeomFromText('POINT..) && geom_column. This operator
as I know works only with MBR (it should be same as equal for points)