[Pgbigm-hackers] Adding similarity() and similarity_op(), '%' to pg_bigm

アーカイブの一覧に戻る

Amit Langote amitl****@gmail*****
2013年 10月 4日 (金) 09:26:32 JST


On Fri, Oct 4, 2013 at 3:44 AM, Fujii Masao <masao****@gmail*****> wrote:
> On Sat, Sep 28, 2013 at 6:16 PM, Beena Emerson <memis****@gmail*****> wrote:
>> Please find attached the updated patch to rebase against the new HEAD and
>> also implements the comments I had given before.
>
> +PG_FUNCTION_INFO_V1(set_bigm_limit);
> +Datum        set_bigm_limit(PG_FUNCTION_ARGS);
> +
> +PG_FUNCTION_INFO_V1(show_bigm_limit);
> +Datum        show_bigm_limit(PG_FUNCTION_ARGS);
>
> I think that it's better to treat the similarity limit as a custom GUC variable
> rather than implementing special functions like the above. If we do that,
> we can change and show the value of the similarity limit as follows. Thought?
>
>     SET pg_bigm.similarity_limit TO 0.001;
>     SHOW pg_bigm.similarity_limit;
>

I think it looks better.

> +/* GIN does not support ordering operators, wait for GiST support...
> +
> +CREATE FUNCTION bigm_similarity_dist(text,text)
> +RETURNS float4
> +AS 'MODULE_PATHNAME'
> +LANGUAGE C STRICT IMMUTABLE;
>
> So we should not include bigm_similarity_dist() at all?
>

It could be added I think. I guess I forgot to remove the comment
around the function itself. So,

> +CREATE OPERATOR =~ (
> +        LEFTARG = text,
> +        RIGHTARG = text,
> +        PROCEDURE = bigm_similarity_op,
> +        COMMUTATOR = '=~',
> +        RESTRICT = contsel,
> +        JOIN = contjoinsel
> +);
>
> The character '~' usually implies regular-expression matches, so
> I don't think that '=~' is good operator name. I think '=%' is better.
> Thought?

Hmm, makes sense. '~' does have a regex feel.

--
Amit




Pgbigm-hackers メーリングリストの案内
アーカイブの一覧に戻る