pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Teodor Sigaev <teodor@sigaev.ru>
To: Pgsql Hackers <pgsql-hackers@postgresql.org>
Subject: Re: KNNGiST for knn-search (WIP)
Date: Fri, 27 Nov 2009 18:23:50 +0300
Message-ID: <4B0FEF06.5050703@sigaev.ru> (raw)
In-Reply-To: <4B0EAE0D.606@sigaev.ru>
References: <4B0AC9E1.5050509@sigaev.ru>
	<4B0EAE0D.606@sigaev.ru>

> Planner (find_usable_indexes function, actually) could push pathkey 
> expression into restriction clauses of index. I'm not fully satisfied 
> with this piece of code, but, may be, someone has a better idea. I 
> though about adding separate indexorderquals in IndexPath structure...

Done, IndexScan and IndexPath have separate field to store order clauses. That's 
allowed to improve explain output:
#  EXPLAIN (COSTS OFF)
   SELECT * FROM point_tbl WHERE f1 <@ '(-10,-10),(10,10)':: box ORDER BY f1 <-> 
'0,1';
                    QUERY PLAN
------------------------------------------------
  Index Scan using gpointind on point_tbl
    Index Cond: (f1 <@ '(10,10),(-10,-10)'::box)
    Sort Cond: (f1 <-> '(0,1)'::point)
(3 rows)

We are waiting feedback to choose a way of planner support of knn-search.

Still TODO:
- cost of index scan
- Sort condition should not be ANDed in explain output
- current patch remove support of  IndexScanDesc->kill_prior_tuple, it's needed 
to restore support if it will not create too big overhead
- documentation

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/

Attachments:

  builtin_knngist-0.4.1.gz (application/x-tar, 26.9K) download

view thread (18+ messages)  latest in thread

Message-ID: <4B0FEF06.5050703@sigaev.ru>
Permalink:  ../4B0FEF06.5050703@sigaev.ru/
Also on:    postgresql.org/message-id/4B0FEF06.5050703@sigaev.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: teodor@sigaev.ru
  Subject: Re: KNNGiST for knn-search (WIP)
  In-Reply-To: <4B0FEF06.5050703@sigaev.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox