Re: "WHERE 1 = 2" does strange things
- From: Frank van Bortel <frank.van.bortel@xxxxxxxxx>
- Date: Thu, 29 Sep 2005 13:45:40 +0200
paulfil wrote:
> "WHERE 1 = 2" is a known trick to clone table structure. It should
> create an empty table. It should work very fast.
> IT DOES NOT. At least when cloning a structure of a view.
>
> Try it and look at explain plan. For some reason, even if it should be
> absolutely clear to ORACLE optimizer that no rows ought to be return,
> it still scans indexes of the tables forming the view. On complex
> views with large tables this turns out to be a costly process.
>
> Does anybody know more effective method to clone structure of a view
> into a new table?
>
I believe in previous versions, an ordered hint helped out
(actually, it's been a Designer bug, as Designer uses such
a where clause to validate the sql generated).
Metalink should be able to help on the designer bug.
--
Regards,
Frank van Bortel
Top-posting is one way to shut me up...
.
- References:
- "WHERE 1 = 2" does strange things
- From: paulfil
- "WHERE 1 = 2" does strange things
- Prev by Date: SQL-statement - BOM problem
- Next by Date: Memory Upgrade for 10g
- Previous by thread: Re: "WHERE 1 = 2" does strange things
- Next by thread: Capturing script output (without the junk)
- Index(es):