I'm using postgresql 9.6 as my database. It takes too much time than the query itself. The query take about 160ms which is not as good as the wanted performance. My query is like :
SELECT DISTINCT code from table where ST_intersects((ST_Transform(ST_PointFromText('POINT(lon lat)', 4326),3857)),geom)
I used this sql query to create spatial indexes
CREATE INDEX table_geom_gist ON table USING GIST (geom);
but it still consume the same time :
VACUUM ANALYZE table
and also tried to update stats :
SELECT UPDATE_GEOMETRY_STATS(table, geom);
but it fires an error that says :
the column table doesn't exist !
Any advice on how to speed up my request and solve this issue ?