Re: RTREE on points
От | Jeff Hoffmann |
---|---|
Тема | Re: RTREE on points |
Дата | |
Msg-id | 3ADAFF38.E7147C8D@propertykey.com обсуждение исходный текст |
Ответ на | RTREE on points ("Julian Scarfe" <julian@avbrief.com>) |
Список | pgsql-sql |
Julian Scarfe wrote: > > explain select * from nodes where box(node,node) @ '((1,1),(3,3))'::box; > NOTICE: QUERY PLAN: > Seq Scan on nodes (cost=0.00..1.10 rows=1 width=28) > this should work, assuming you have enough points to make a difference (in the optimizer's mind, at least). the optimizer still doesn't do a great job of knowing when it's best to use an index, although, in your sample, there's no way it would ever be cheaper to use an index. there's simply not enough data there. you can test to see if an index can be used by a query by shutting off the sequential scans (set enable_seqscan=off) and retrying the query. essentially, this forces it to use an index scan if at all possible. -- Jeff Hoffmann PropertyKey.com
В списке pgsql-sql по дате отправления: