Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Select multiple rows from DUAL ?
Anurag Varma wrote:
> "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)
SQL*Plus: Release 10.1.0.3.0 - Production on Wed Jan 12 17:24:59 2005
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> set linesize 140
SQL> explain plan for select user from table(array_t(1));
Explained.
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ---------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 8168 | | 24 (0)| 00:00:01 | | 1 | COLLECTION ITERATOR CONSTRUCTOR FETCH| | | | | | ----------------------------------------------------------------------------------------------
8 rows selected.
SQL> explain plan for select /*+ cardinality(t 1) */ user from table(array_t(1));
Explained.
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ---------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 8168 | | 24 (0)| 00:00:01 | | 1 | COLLECTION ITERATOR CONSTRUCTOR FETCH| | | | | | ----------------------------------------------------------------------------------------------
8 rows selected.
SQL> Not here.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Wed Jan 12 2005 - 19:30:27 CST