BUG #2126: Index usage for function value

Поиск
Список
Период
Сортировка
От Grzegorz Tańczyk
Тема BUG #2126: Index usage for function value
Дата
Msg-id 20051225145410.DF2C9F0AC8@svr2.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #2126: Index usage for function value  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      2126
Logged by:          Grzegorz Tańczyk
Email address:      goliatus@polzone.pl
PostgreSQL version: 8.1
Operating system:   Slackware
Description:        Index usage for function value
Details:

SELECT * FROM table WHERE id = myfunction('x', 10);

There is an index created on id column, but query planner doesn't use it.

When I explain this query:
SELECT * FROM table WHERE id = (SELECT myfunction('x', 10))
Then index is used and execution is much faster.

Is this subquery nessesary?

It doesn't happen in all circumstances, but when query is more complex and
table is big then it happens.

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

Предыдущее
От: zhuge xiao
Дата:
Сообщение: Re: BUG #2118: could not connect to server
Следующее
От: "venkat"
Дата:
Сообщение: BUG #2128: unable to install win32 version of pgsql 8.1.1