Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> query rewrite and ORDER BY: help please

query rewrite and ORDER BY: help please

From: <pwenker_at_my-deja.com>
Date: Tue, 29 Aug 2000 23:31:01 GMT
Message-ID: <8ohh3l$ib5$1@nnrp1.deja.com>

Hi,

I wonder if anyone can give me any information about the relationship between query rewrite and an ORDER BY clause in the SQL "intended" for a Materialized View.

Here's the situation: I have query rewrite going successfully against a MV when there is no ORDER BY clause in the SQL, but when I add an ORDER BY clause (the ORDER BY clause contains only columns referenced in the SELECT clause that created the MV) to the SQL the query rewrite doesn't happen: EXPLAIN PLAN shows the query path as hitting the source tables instead of the MV.

Anyone out there ever enconter a similiar situation?

NOTE: I have a different scenario in which SQL with an ORDER BY clause *does* successfully re-write to hit a MV. The difference: this MV is an aggregate created with a GROUP BY clause. The one that's not working is not an aggregation, just a table join. I tried using a GROUP BY clause that doesn't aggregate (all columns in the SELECT clause also in the GROUP BY clause) but no dice.

Any help is appreciated, Thanks! --Peter

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Aug 29 2000 - 18:31:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US