Обсуждение: gsoc knn spgist
<div>Helllo.</div><div> </div><div>I want to implement knn for spgist. I dont have question with knn, but have questionswith implementation of interface.</div><div> </div><div>i modify pg_am.h (set amcanorderbyop to true in spgistindex).Also i modify pg_amop.h(add </div><div> </div><div>DATA(insert ( 4015 600 600 15 o 517 4000 1970 ));</div><div> </div><div>)</div><div> </div><div>explainSELECT * FROM quad_point_tbl ORDER BY p <-> '-2,50'</div><div> </div><div> Sort (cost=1219.31..1246.82 rows=11003 width=16)<br /> Sort Key: ((p <-> '(-2,50)'::point))<br/> -> Index Only Scan using sp_quad_ind on quad_point_tbl (cost=0.15..480.70 r<br />ows=11003width=16)</div><div><span lang="en"><span>what</span> <span>am I doing wrong</span><span>?</span></span></div><div><spanlang="en"><span>In a gist index we have :<br /></span></span></div><div> </div><div><spanlang="en"><span>regression=# explain SELECT * FROM point_tbl ORDER BY f1 <->'-3,0';<br /> QUERY PLAN <br />----------------------------------------------------------------------------<br/> Index Scan using gpointind on point_tbl (cost=0.13..8.27 rows=7 width=16)<br /> Order By: (f1 <-> '(-3,0)'::point)<br /> Planning time: 0.166 ms<br/>(3 rows)<br /></span></span></div><div> </div><div><span lang="en"><span>Are there</span> <span>documents about modificationaccess methods</span><span>?</span></span></div><div> </div><div><span lang="en"><span>Thanks.</span></span></div><div><spanlang="en"><span>Constantine Kuznetsov</span></span></div>
On Fri, Apr 4, 2014 at 11:56 AM, Костя Кузнецов <chapaev28@yandex.ru> wrote: > I want to implement knn for spgist. I dont have question with knn, but have > questions with implementation of interface. > > i modify pg_am.h (set amcanorderbyop to true in spgist index).Also i modify > pg_amop.h(add > > DATA(insert ( 4015 600 600 15 o 517 4000 1970 )); > > ) > > explain SELECT * FROM quad_point_tbl ORDER BY p <-> '-2,50' > > Sort (cost=1219.31..1246.82 rows=11003 width=16) > Sort Key: ((p <-> '(-2,50)'::point)) > -> Index Only Scan using sp_quad_ind on quad_point_tbl > (cost=0.15..480.70 r > ows=11003 width=16) > what am I doing wrong? I don't know. I think there are a lot of possibilities based on the information provided. A simple explanation would be that the planner considered the plan you want and found the other one cheaper, but the real cause could well be something else. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company