From: Teodor Sigaev <teodor@sigaev.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Pgsql Hackers <pgsql-hackers@postgresql.org>
Subject: Re: KNNGiST for knn-search (WIP)
Date: Fri, 27 Nov 2009 19:26:22 +0300
Message-ID: <4B0FFDAE.4090201@sigaev.ru> (raw)
In-Reply-To: <27610.1259336294@sss.pgh.pa.us>
References: <4B0AC9E1.5050509@sigaev.ru>
<4B0EAE0D.606@sigaev.ru>
<4B0FEF06.5050703@sigaev.ru>
<27610.1259336294@sss.pgh.pa.us>
>> Done, IndexScan and IndexPath have separate field to store order clauses.
>
> Why? Isn't that redundant with the pathkey structures? We generate
> enough paths during a complex planning problem that I'm not in favor
> of adding unnecessary structures to them.
I found two ways to add support of knn-seaech to planner
- 0.4 version: add sorting clauses to restrictclauses in find_usable_indexes,
and there is two issues:
- find_usable_indexes could not be used to find indexes for index and bitmap
scans at once, because sorting clauses will be used in bitmap scan. Full
scan of index with knn-ordering on large index is much more expensive.
- implied/refused predicate machinery is teached to ignore sorting clauses,
but it's not so obvious: it should ignore operation returning non-boolean
values
- 0.4.1 version: pull sort clauses separately and merge them with regular
clauses at create_indexscan_plan function. That's solves problems above
Do you suggest to construct that clauses from pathkey representation? And append
constructed clauses to indexquals in create_indexscan_plan?
--
Teodor Sigaev E-mail: teodor@sigaev.ru
WWW: http://www.sigaev.ru/
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, tgl@sss.pgh.pa.us
Subject: Re: KNNGiST for knn-search (WIP)
In-Reply-To: <4B0FFDAE.4090201@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