开发者社区> 问答> 正文

给postgis里面得st_intersects函数创建索引以后为什么不管用

location字段存储的是geography类型,srid是4326,直接调用postgis中的st_contains或者其他的st_intersects函数时,location字段上面的索引是不是就不起作用了
select count(distinct mmsi) from (select * from geo where st_intersects(location,'srid=4326;polygon((121.0372458500172 31.00314323431651,122.0765325921255 30.88135628077687,122.2036476479218 31.68007359031177,121.1784180146399 31.80800029134435,121.0372458500172 31.00314323431651))')) as foo where crawl_time between '2018-12-29 18:40:00' and '2019-01-02 19:00:00';比如这条sql查询某区域内某段时间内的数据,location字段的索引就没用到

image

展开
收起
我叫石头 2019-01-09 20:45:05 2804 0
1 条回答
写回答
取消 提交回答
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Phoenix Search Index 功能与应用场景介绍 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载