| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: CURSORS : SELECT * VERSUS SELECT only necessary columns
janik_at_pobox.sk (Jan) wrote in message news:<81511301.0112060745.6ba7a032_at_posting.google.com>...
> I wanto to tune my procedures. I have many independent procedures,
> which check data in one table with many rows. E.g. the 1-st proceure
> needs COL_1 and COL_2, 2-nd COL_1 and COL_3, 3-rd COL_1 and COL_5 etc.
> from 1 row.
> Sometimes all procedures are executed, sometimes only few of them - it
> depends on the values in that rows.
>
> Question:
>
> What is better - If I use in cursors
>
> 1> SELECT * FROM table WHERE id=p_id..
This is Better if you are also using Bind Variables then this statment is Cached in Shared Pool and reused(Soft Parsed). Where as the Next Select Stmt is Hard Parsed everytime it is issued and it is going to pull your performance down.
> and it will be in SQL Cache as 1 SQL statment, but every times
> many unnecessary columns will be selected
>
> or
>
> 2> SELECT what I exactly need FROM table WHERE id=p_id..
> but almost each procedure will have different SELECT
>
--see Above
>
>
> Thank you,
>
> Jan
HTH
Regards,
Ganesh R
Received on Fri Dec 07 2001 - 22:58:29 CST
![]() |
![]() |