小编Stu*_*tuR的帖子

未使用 Postgres point() 索引

\d 聚合

              Materialized view "public.aggregate"
          Column      |            Type             | Modifiers 
    ------------------+-----------------------------+-----------
     id               | integer                     | 
     searchable       | text                        | 
     name             | character varying(255)      | 
     source_type      | character varying(255)      | 
     source_id        | integer                     | 
     latitude         | double precision            | 
     longitude        | double precision            | 
     created_at       | timestamp without time zone | 
     updated_at       | timestamp without time zone | 

Indexes:
    "aggregate_lat_lng_point" gist (point(latitude, longitude))
    "searchable_tsvector" gin (to_tsvector('english'::regconfig, COALESCE(searchable, ''::text)))
Run Code Online (Sandbox Code Playgroud)

询问:

EXPLAIN ANALYZE SELECT name FROM aggregate 
WHERE point(53.574753, -2.1) <@> point(latitude, longitude) …
Run Code Online (Sandbox Code Playgroud)

postgresql index postgresql-9.3

4
推荐指数
1
解决办法
1324
查看次数

标签 统计

index ×1

postgresql ×1

postgresql-9.3 ×1