Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] create view as select distinct (fwd)

From: jwieck(at)debis(dot)com (Jan Wieck)
To: phd2(at)earthling(dot)net
Cc: pgsql-hackers(at)postgreSQL(dot)org, ran(at)pirit(dot)com
Subject: Re: [HACKERS] create view as select distinct (fwd)
Date: 1999-04-26 06:57:27
Message-ID: m10bfKZ-000EBZC@orion.SAPserv.Hamburg.dsh.de (view raw or flat)
Thread:
Lists: pgsql-hackers
Oleg Broytmann wrote:

>
> Hello!
>
>    VIEW on 6.4.2 ignores DISTINCT. Is it a bug? known?
>

    It's  a known missing feature (not a bug - more like a design
    fault).

    DISTINCT is implemented as a unique sort step taken over  the
    final  result of a query. Views are implemented via the query
    rewrite rule system. If now someone would define  a  DISTINCT
    view and selects a join of it with another table, the rewrite
    system cannot tell the planner that only the scan's resulting
    from  the  view  should be sorted unique.  It could only tell
    that the entire result should be DISTINCT - what's wrong - so
    I left it out.

    I'm  planning  to  implement some kind of subquery rangetable
    entries someday. At that time, all these problems  (DISTINCT,
    GROUP BY, ORDER BY) of views will disappear.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck(at)debis(dot)com (Jan Wieck) #



Responses

pgsql-hackers by date

Next:From: Zeugswetter Andreas IZ5Date: 1999-04-26 07:00:46
Subject: AW: [HACKERS] Re: light dawns: serious bug in FE/BE protocol handling
Previous:From: Vadim MikheevDate: 1999-04-26 06:57:03
Subject: Re: [HACKERS] A patch for FATAL 1:btree: BTP_CHAIN flag was expected

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group