| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Access Paths: Will these produce equivalent results?
We are migrating an MS SQLServer database to Oracle, and have come
across a query that runs significantly faster on SQLServer than
Oracle. It is an MS Access generated sql that looks like:
select colA, colB, sum(colC), sum(colD)
from tab1
where colE = 'somelit'
group by colA, colB
having colA = 'somelit' and colB = 'somelit'
When comparing access plans between Oracle and SQLServer, Oracle first performs the roll up, then filters the results. However, SQLServer applies the "having " predicate to tab1 *first*, then performs the summations. In fact for SQLServer, the access path for the above query is identical for this one:
select colA, colB, sum(colC), sum(colD)
from tab1
where colE = 'somelit' and colA = 'somelit' and colB = 'somelit'
group by colA, colB
My question is, is this correct behavior? Is SQLServer guaranteed to produce the same results, no matter what's in the tables? Received on Fri May 09 2003 - 13:41:50 CDT
![]() |
![]() |