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: Varray Problem

Re: Varray Problem

From: <ryan_oracle_at_cox.net>
Date: Thu, 04 Dec 2003 07:39:41 -0800
Message-ID: <F001.005D8CB5.20031204073941@fatcity.com>


Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit

cost is irrelevant. ignore it. it doesnt matter. its internal for oracle. what docs are you using that say to use cost? none from oracle. they dont exist.

have your Logical I/Os gone up? Has your response time gone up?

I can guess as to why its more 'costly'? By accessing the varray do you do this:

SELECT VARRAY
FROM TABLE Or

SELECT COLS
FROM TABLE
WHERE VARRAY = <Some value>

VARRAY isnt atomic. Oracle has to do more work in retrieving it. Its a different data structure than a standard row.

however, ignore the cost. Its completely useless. Show me any credible documentation that says to use the cost and not just some person who wrote an article on some website.
>
> From: B3D70 <nareswara_at_balicamp.com>
> Date: 2003/12/04 Thu AM 05:12:16 EST
> To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
> Subject: Varray Problem
>
> Hi there ...
> I have a table with a Varray Columns.
> When I used a select operation without access the varray columns the
> explain plan show fine.. cost = 4
> but when I access the Varray columns then I got the cost = 1310
>
> Why ? What happend ? and why oracle did it ?
> Someone can explain it to me ?
> or how shoud I optimized it ?
>
> this is my query without varrary
> SELECT a.id,
> a.address
> FROM my_table a
>
> Operation Object Name Rows Bytes Cost
> SELECT STATEMENT
> Hint=CHOOSE 3 4
>
> SORT GROUP
> BY 3 60 4
>
> TABLE ACCESS
> FULL MY_TABLE 9 180 2
>
>
>
> this is my query with varrary
> SELECT a.id,
> a.address
> FROM my_table a, TABLE(a.no_of_car) b
>
> Operation Object Name Rows Bytes Cost
> SELECT STATEMENT
> Hint=CHOOSE 3 1310
>
> SORT GROUP
> BY 3 459 1310
>
> NESTED LOOPS 73 K 10
> M 101
> TABLE ACCESS FULL MY_TABLE 9 1
> K 2
> COLLECTION ITERATOR PICKLER
> FETCH
>
>
> regards
> kang bedjo
>

------=____1070543476178_OMlJCWxDbh
Content-Type: text/html;
 name="reply"
Content-Disposition: inline;
 filename="reply"

<html>
<body>
Hi there ...<br>
I have a table with a Varray Columns. <br> When I used a select operation without access the varray columns the explain plan show fine.. cost = 4<br>
but when I access the Varray columns then I got the cost = 1310<br><br> Why ? What happend ? and why oracle did it ?<br> Someone can explain it to me ?<br>
or how shoud I optimized it ?<br><br>
this is my query without varrary<br>
<font face="Courier New, Courier" size=3 color="#0000F0"><b>SELECT</b></font><font face="Courier New, Courier" size=3>&nbsp;&nbsp; a.id,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a.address<br> </font><font face="Courier New, Courier" size=3 color="#0000F0"><b>FROM</b></font><font face="Courier New, Courier" size=3>&nbsp;&nbsp;&nbsp;&nbsp; my_table a<br><br>
</font><font face="Courier New, Courier" size=2>Operation<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>Object Name<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>Rows<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>Bytes<x-tab>&nbsp;&nbsp;&nbsp;</x-tab>Cost<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><br> SELECT STATEMENT
Hint=CHOOSE<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>3&nbsp; <x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>

<x-tab>&nbsp;&nbsp;&nbsp;&nbs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</x-tab>180&nbsp; <x-tab>&nbsp;&nbsp;&nbsp;</x-tab>2&nbsp; <x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab> <x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <x-tab>&nbsp;&nbsp;</x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <x-tab>&nbsp;&nbsp;&nbsp;</x-tab> <br><br>
<br>

</font>this is my query with varrary<br> <font face="Courier New, Courier" size=3 color="#0000F0"><b>SELECT</b></font><font face="Courier New, Courier" size=3>&nbsp;&nbsp; a.id,<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a.address<br> </font><font face="Courier New, Courier" size=3 color="#0000F0"><b>FROM</b></font><font face="Courier New, Courier" size=3>&nbsp;&nbsp;&nbsp;&nbsp; my_table a, TABLE(a.no_of_car) b<br><br> </font><font face="Courier New, Courier" size=2>Operation<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Object Name<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>Rows<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>Bytes<x-tab>&nbsp;&nbsp;&nbsp;</x-tab>Cost<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><br>
SELECT STATEMENT Hint=CHOOSE<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>3&nbsp; <x-tab>&nbsp;&nbsp;&nb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;&nbsp;&nbsp;</x-tab>&nbsp; <x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab> <x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab> <x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab> <x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <x-tab>&nbsp;&nbsp;</x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <x-tab>&nbsp;&nbsp;&nbsp;</x-tab> <br><br> <br>
regards<br>
kang bedjo</font></body>
</html>

------=____1070543476178_OMlJCWxDbh--

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: <ryan_oracle_at_cox.net
  INET: ryan_oracle_at_cox.net

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Dec 04 2003 - 09:39:41 CST

Original text of this message

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