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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Stop Criteria for Sql Execution

RE: Stop Criteria for Sql Execution

From: Khedr, Waleed <Waleed.Khedr_at_FMR.COM>
Date: Mon, 7 Mar 2005 14:49:48 -0500
Message-ID: <42BBD772AC30EA428B057864E203C9990123375F@MSGBOSCLF2WIN.DMN1.FMR.COM>


This question might look simple but the fact is it has to do with a bigger issue.
I'm splitting a big table in a data warehouse based on certain conditions into two tables and I want to create a view that union-all on the two tables. For some reports one of the tables will not have any data to return and I want to make sure no time will be spent finding data in that table.
So a view will be created on the table that will have some predicate like "column1=3D10"
The outer view will be a union-all of this view and the other table (or view).
When a user submits a sql that has a predicate "column1=3D20", this predicate will be pushed to the two internal views. One of the tables will end up having "where column1=3D10 and = column1=3D20",
and the sql will stop without scanning that table.

Waleed

-----Original Message-----

From: Mercadante, Thomas F [mailto:thomas.mercadante_at_labor.state.ny.us]=20 Sent: Monday, March 07, 2005 1:40 PM
To: Khedr, Waleed; oracle-l_at_freelists.org Subject: RE: Stop Criteria for Sql Execution=20

Waleed,

Maybe Oracle should be smarter and recognize the craziness of the query.

But then, maybe the developer should also recognize the problem.

Perhaps your frustration is pointing in the wrong direction?

Tom

-----Original Message-----

From: Khedr, Waleed [mailto:Waleed.Khedr_at_FMR.COM]=20 Sent: Monday, March 07, 2005 11:38 AM
To: oracle-l_at_freelists.org
Subject: Stop Criteria for Sql Execution=20

Why does Oracle have to execute the sql and scan data in a table for a sql like this:

Select * from table
Where column1 is null and column1=3D3D10

Or=3D20

Select * from table
Where column1=3D3D10 and column1=3D3D20

All the research money going to optimize the optimizer, and still can't take care of simple stuff like this.

Am I missing something?

I will probably start searching for smarter databases :)

Waleed
--

http://www.freelists.org/webpage/oracle-l
--

http://www.freelists.org/webpage/oracle-l Received on Mon Mar 07 2005 - 14:53:05 CST

Original text of this message

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