Index not used on a DISTINCT ON

Поиск
Список
Период
Сортировка
От Gaetano Mendola
Тема Index not used on a DISTINCT ON
Дата
Msg-id b5eo8g$834$1@news.hub.org
обсуждение исходный текст
Ответы Re: Index not used on a DISTINCT ON  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-admin
Hi all,

I have a table with two column:   id_user and login;

and the column login is a Primary Key.

If I made the following view:
CREATE VIEW foo
    SELECT DISTINCT ON ( login )
        ul.id_login       AS login,
        ud.last_name  AS last_name,
    FROM user_login ul LEFT JOIN v_user_traffic v USING ( id_user)
                user_data ud
   WHERE  ul.id_user = ud.id_user;

when is used in this way:

    SELECT * FROM foo WHERE login = 'XXXXXX';

the index is not used if I remove the DISTINCT ON
the filter is used!!!

Is it a known issue ?








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

Предыдущее
От: aris_it@csahome.com
Дата:
Сообщение: Re: I can't connect to phpPgAdmin
Следующее
От: "Marc Soler"
Дата:
Сообщение: How to... in update