Index not used on a DISTINCT ON

From: "Gaetano Mendola" <mendola(at)bigfoot(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Index not used on a DISTINCT ON
Date: 2003-03-21 10:07:22
Message-ID: b5eo8g$834$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 ?

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Marc Soler 2003-03-21 10:17:25 How to... in update
Previous Message Nigel Bishop 2003-03-21 10:07:08 Any Monitoring Tools for Postgres?