Thanks for your replay.
 
There is b-tree index on last_name, Partition is actually on a different 
column bill_num, which is also used for search. However in this case, it is 
the last name search that is slow. 
 
I should also mention that the p_in_lastname input parameter is always 
upper, e.g. 'SMITH%'. The search, e,g, 'SMITH%' can return multiple users, 
e.g. John Smith, Bill Smith, etc.
 
Ning
 

On Wednesday, February 20, 2013 12:56:45 AM UTC-5, Ninja Li wrote:

> Hi, 
>
> I would like to ask for some advice on the design of PL/SQL procedure. I 
> am trying to improve the performance of a PL/SQL procedure which allows a 
> user to do search by their  last name and returns their account 
> information. I will be joining two tables, customer_info (with last name as 
> a column ) and account_details, with 8 million and 50 million rows 
> respectively by user ID on each table. The procedure is already in place 
> and very straight forward, which goes something like the following:
>
> procedure name_search ( p_in_user_id number, p_in_lastname varchar2 ,,,)
> {
>   .......
>    open cursor for 
>    select a.column1, a.column2, b.column1, b.column2, .....
>    from   customer_info a, account_details b
>    where a.user_id = b.user_id
>    and     a.last_name like p_in_lastname || '%';
> }
>
> The execution time varies from 3 to 15 seconds. 
>
> I would like to ask if there are other ways to write the procedure, such 
> as using with clause or global temporary tables which can significantly 
> improve performance in your experience.
>
> The tables already have partition and indexes on last_names, user_id in 
> place.
>
> Thanks in advance.
>
> Nick
>
>
>
>
>
>
>
>
>
>   
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle-PLSQL@googlegroups.com
To unsubscribe from this group, send email to
oracle-plsql-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Oracle PL/SQL" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to oracle-plsql+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to