Index not used on a DISTINCT ON - Mailing list pgsql-admin

From Gaetano Mendola
Subject Index not used on a DISTINCT ON
Date
Msg-id b5eo8g$834$1@news.hub.org
Whole thread Raw
Responses Re: Index not used on a DISTINCT ON
List 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 by date:

Previous
From: aris_it@csahome.com
Date:
Subject: Re: I can't connect to phpPgAdmin
Next
From: "Marc Soler"
Date:
Subject: How to... in update