[rt-devel] SearchBuilder DISTINCTs
    Robert Spier 
    rspier at pobox.com
       
    Thu Feb 20 14:42:11 EST 2003
    
    
  
> Sure, but you are forcing constraints on the query that can not be altered
> or influenced using the query-altering parts of the API, ala Limit. I would
> not have made that design decision, I think it's bogus. 
By definition SearchBuilder only returns unique objects.  If the same
object/instance is returned twice in a single query, that is _wrong_,
for how SearchBuilder was designed.
> I'm curious what problems you are envisioning with removing distinct from 
> a majority of the queries? For anything other then joins it seems like your
> pkeys should be sufficient, and in the case of joins you (the caller) 
> ultimately must understand the implications of the query you are executing. 
> So I don't think it is unreasonable to force them to set a distinct flag. 
Joins exist in all but the simplest queries in SearchBuilder and most
other OO-RDBMS mappers.  And, the whole purpose of an OO-RDBMS mapper
is to insulate the the user/programmer from the RDBMS.
There are several ways to change how SearchBuilder works such that
DISTINCT is not needed, but the penalty is performance.  
-R
    
    
More information about the Rt-devel
mailing list