Re: knngist - 0.8

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: knngist - 0.8
Date: 2010-10-19 15:11:15
Message-ID: 4CBDB513.9020108@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>> 3) 3-rd boolean column (amopopr, amopfamily, amoporder)
>> - could be two records per operator
>> + operator could be used in both roles
>> + strategy number could be different for different roles

> How can #3 work at all? It's ignoring a couple of critical index
> columns. In particular, I believe the sticking point here is this
> unique index:
>
> "pg_amop_fam_strat_index" UNIQUE, btree (amopfamily, amoplefttype, amoprighttype, amopstrategy)
>
I believe, that columns (amoplefttype, amoprighttype) are fixed for operation
and could not be changed. So, two operations in one opfamily should be differ in
strategy number for different roles. It also gives a direct way to transfer
knowledge abot role to consistent method of GiST.

> I'm not terribly thrilled with using a boolean here in any case.
> Now that we have two "roles" an operator might play in an opclass,
> who's to say there might not be more roles someday? We should use
> a column type that will support more than two roles without basic
> rejiggering.

It's easy to change to char type, for now only 's'search and 'o'order characters
will be allowed.

> BTW, have we discussed the idea of embedding the role in the strategy
> number? For example, require regular operators to have strategy

In this schema, one operator could not be used in more than one role. Right now
it's not strict limitation, because the we still don't have an example of
boolean distance.

Anyhow, it needs to distinguish roles while IndexPath is built. So,
op_in_opfamily/get_op_opfamily_strategy/get_op_opfamily_properties and friends
will accept extra argument pointing to interested role.
--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2010-10-19 15:16:21 Re: knngist - 0.8
Previous Message Bruce Momjian 2010-10-19 15:06:51 Re: O_DSYNC broken on MacOS X?