[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [HACKERS] knngist - 0.8
From:       Alexander Korotkov <aekorotkov () gmail ! com>
Date:       2010-07-29 19:38:56
Message-ID: AANLkTinV_HK3CLC6_98coYkorPC75vsdYO7vheTmv5Yd () mail ! gmail ! com
[Download RAW message or body]

I think that queries like this:
select * from test where val <-> 500 < 1 order by val <-> 500;
can also be optimized using knngist. In case of btree_gist this query can be
easily rewritten:
select * from test where val > 499 and val < 501 order by val <-> 500;
But, in pg_trgm it makes it possible to combine different similarity levels
in one query. For example:
select * from test_trgm order by t <-> 'asdf' < 0.5 or t <-> 'qwer' < 0.4;
Is there any chance to handle this syntax also?

----
With best regards,
Alexander Korotkov.

[Attachment #3 (text/html)]

I think that queries like this:<br>select * from test where val &lt;-&gt; 5=
00 &lt; 1 order by val &lt;-&gt; 500;<br>can also be optimized using knngis=
t. In case of btree_gist this query can be easily rewritten:<br>select * fr=
om test where val &gt; 499 and val &lt; 501 order by val &lt;-&gt; 500;<br>


But, in pg_trgm it makes it possible to combine different similarity levels=
 in one query. For example:<br>select * from test_trgm order by t &lt;-&gt;=
 &#39;asdf&#39; &lt; 0.5 or t &lt;-&gt; &#39;qwer&#39; &lt; 0.4;<br>Is ther=
e any chance to handle this syntax also?<br>

<br>----<br>With best regards,<br>Alexander Korotkov.<br>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic