Part 2 of "Intentional, or a bug"....

Поиск
Список
Период
Сортировка
От Kovacs Baldvin
Тема Part 2 of "Intentional, or a bug"....
Дата
Msg-id Pine.GSO.4.33.0109162349570.1893-100000@ural2
обсуждение исходный текст
Ответы Re: Part 2 of "Intentional, or a bug"....  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Hi again.

First of all, tank you for the immediate and precise answers.

My solution to the problem was the following. However, I found
that to be quite slow. I would like to ask if one can suggest me
how to optimize this, because I need this regularly.

CREATE FUNCTION gyegyenlo(text, text) RETURNS boolean AS ' SELECT CASE WHEN $1 is null and $2 is null THEN true
                        ELSE ($1) = ($2)      END;
 
' LANGUAGE 'sql';

CREATE OPERATOR ~= ( leftarg = text, rightarg = text, procedure = gyegyenlo, commutator = ~=
);

After these I use ~= if I need lines with NULLs in both to be selected.

The only problem is that it makes the query very slow. Does anyone
knows how to optimize this?

Thanks,
Baldvin




В списке pgsql-sql по дате отправления:

Предыдущее
От: "Josh Berkus"
Дата:
Сообщение: Re: optimizing queries and indexes...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Part 2 of "Intentional, or a bug"....