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 -> Re: Select multiple rows from DUAL ?

Re: Select multiple rows from DUAL ?

From: Anurag Varma <avdbi_at_hotmail.com>
Date: Tue, 11 Jan 2005 13:16:02 GMT
Message-ID: <mkQEd.139159$AL5.19610@twister.nyroc.rr.com>

"DA Morgan" <damorgan_at_x.washington.edu> wrote in message news:41e35ae7$1_3_at_127.0.0.1...
> Anurag Varma wrote:
>
> > The rows estimation can probably be fixed by using hint
> > select /*+ cardinality(t 1) */ user from table(array_t(1)) t;
> >
> > Anurag
>
> Didn't do it. Still 8168 rows with cost of 24.
> --
> Daniel A. Morgan
> University of Washington
> damorgan_at_x.washington.edu
> (replace 'x' with 'u' to respond)

Well .. it works for me in 9.2.0.3. Maybe a typo in your test case?:

ORA92> explain plan for select user from table(myarray(1));

Explained.

ORA92> select * from table(dbms_xplan.display);

PLAN_TABLE_OUTPUT



| Id  | Operation                             |  Name       | Rows  | Bytes | Cost  |
-------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                      |             |  8168 |       |    17 |
|   1 |  COLLECTION ITERATOR CONSTRUCTOR FETCH|             |       |       |       |
-------------------------------------------------------------------------------------

Note: cpu costing is off

9 rows selected.

ORA92> explain plan for select /*+ cardinality(t 1) */ user from table(myarray(1)) t;

Explained.

ORA92> select * from table(dbms_xplan.display);

PLAN_TABLE_OUTPUT



| Id  | Operation                             |  Name       | Rows  | Bytes | Cost  |
-------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                      |             |     1 |       |    17 |
|   1 |  COLLECTION ITERATOR CONSTRUCTOR FETCH|             |       |       |       |
-------------------------------------------------------------------------------------

Note: cpu costing is off

9 rows selected.

Anurag Received on Tue Jan 11 2005 - 07:16:02 CST

Original text of this message

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