Re: Indexing for geographic objects?
От | Tom Lane |
---|---|
Тема | Re: Indexing for geographic objects? |
Дата | |
Msg-id | 1127.976298367@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Indexing for geographic objects? (Oleg Bartunov <oleg@sai.msu.su>) |
Ответы |
Re: Indexing for geographic objects?
|
Список | pgsql-hackers |
Oleg Bartunov <oleg@sai.msu.su> writes: >> 5000 looks like a suspiciously round number ... how many rows are in >> the table? Have you done a vacuum analyze on it? > about 10,000 rows, So the thing is estimating 0.5 selectivity, which is a fallback for operators it knows nothing whatever about. [ ... digs in Selkov's scripts ... ] CREATE OPERATOR @ ( LEFTARG = seg, RIGHTARG = seg, PROCEDURE = seg_contains, COMMUTATOR = '~' ); CREATE OPERATOR ~ ( LEFTARG = seg, RIGHTARG = seg, PROCEDURE = seg_contained, COMMUTATOR = '@' ); Sure 'nuff, no selectivity info attached to these declarations. Try adding RESTRICT = contsel, JOIN = contjoinsel to them. That's still an entirely bogus estimate, but at least it's a smaller bogus estimate ... small enough to select an indexscan, one hopes (see utils/adt/geo_selfuncs.c). I have not dug through Gene's stuff to see which other indexable operators might be missing selectivity estimates, but I'll bet there are others. If you have the time to look through it and submit a patch, I can incorporate it into the version that will go into contrib. regards, tom lane
В списке pgsql-hackers по дате отправления: