How can I Improve the Performance using Global Temo Tables ??

Hi,
Can anyone tell me , How can i make use of Global Temporary Tables to improve the Performance.
I have few sample scripts ,
Say i have the View based on some Complex query like ,
CREATE OR REPLACE VIEW Profile_values_view AS
SELECT d.Profile_option_name, d.Profile_option_id, Profile_option_value,
u.User_name, Level_id, Level_code
FROM Profile_definitions d, Profile_values v, Profile_users u
WHERE d.Profile_option_id = v.Profile_option_id
AND ((Level_code = 'USER' AND Level_id = U.User_id) OR
(Level_code = 'DEPARTMENT' AND Level_id = U.Department_id) OR
(Level_code = 'SITE'))
AND NOT EXISTS (SELECT 1 FROM PROFILE_VALUES P
WHERE P.PROFILE_OPTION_ID = V.PROFILE_OPTION_ID
AND ((Level_code = 'USER' AND
level_id = u.User_id) OR
(Level_code = 'DEPARTMENT' AND
level_id = u.Department_id) OR
(Level_code = 'SITE'))
AND INSTR('USERDEPARTMENTSITE', v.Level_code) >
INSTR('USERDEPARTMENTSITE', p.Level_code));
Now i have created the Global temp Table as ,
CREATE GLOBAL TEMPORARY TABLE Profile_values_temp
Profile_option_name VARCHAR(60) NOT NULL,
Profile_option_id NUMBER(4) NOT NULL,
Profile_option_value VARCHAR2(20) NOT NULL,
Level_code VARCHAR2(10) ,
Level_id NUMBER(4) ,
CONSTRAINT Profile_values_temp_pk
PRIMARY KEY (Profile_option_id)
) ON COMMIT PRESERVE ROWS ORGANIZATION INDEX;
Now I am Inserting the Records into Temp table as
INSERT INTO Profile_values_temp
(Profile_option_name, Profile_option_id, Profile_option_value,
Level_code, Level_id)
SELECT Profile_option_name, Profile_option_id, Profile_option_value,
Level_code, Level_id
FROM Profile_values_view;
COMMIT;
Now what my doubt is, when do i need to execute the Insert Statement.
Say , if the View returns few millions of records , then loading such a data into Global Temporary table takes lot of time.
Then what is the use of Global Temporary tables and how can i improve the Performance using the same.
Raj

Thanks for the responce ,
There are 2 to 3 complex views in our database, and there always be more than 5000+ users will be workinf on the application and is OLTP application. Those complex views are killing the application performance.
I what i felt was, if i create the Global Temporary tables for thow views and will be able to load the one third million of records returned by the views in to cache and can improve the application performance.
I have created the Global Temporary tables for 2 views with the option On Commit Preserve , But after am inserting the records into the Temp table and when i Issue the commit statement, the Temp table is getting Cleared.
I really got surpised of this behaviour as i know that with the Option On Commit Preserve , the rows should retain in the Temp Table, Instead , it's getting cleared.
Pelase suggest , what to do ??
Raj

Similar Messages

  • How can i write the trigger for Global Temporary Table

    Hi Grus,
    How can i write the trigger for Global Temporary Table.
    I was created the GTT with trigger using the below script .
    CREATE GLOBAL TEMPORARY TABLE GLOBAL_TEMP
    EMP_C_NAME VARCHAR2(20 BYTE)
    ON COMMIT PRESERVE ROWS;
    CREATE OR REPLACE TRIGGER TRI_GLOBAL_TEMP
    BEFORE DELETE OR UPDATE OR INSERT
    ON GLOBAL_TEMP
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    INSERT INTO EMPNAME VALUES (:OLD.EMP_C_NAME);
    END;
    trigger was create successfully, but the wouldn't insert into to EMPNAME Table..
    Please guide whether am correct or not? if not kindly give a correct syntax with example
    Thanks in Advance,
    Arun M M

    BEGIN
    INSERT INTO EMPNAME VALUES (:OLD.EMP_C_NAME);
    END;
    you are referencing old value in insert stmt.
    BEGIN
    INSERT INTO EMPNAME VALUES (:new.EMP_C_NAME);
    END;then run ur application it works fine...
    CREATE GLOBAL TEMPORARY TABLE GLOBAL_TEMP
    EMP_C_NAME VARCHAR2(20 BYTE)
    ON COMMIT PRESERVE ROWS;
    CREATE OR REPLACE TRIGGER TRI_GLOBAL_TEMP
    BEFORE DELETE OR UPDATE OR INSERT
    ON GLOBAL_TEMP
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    dbms_output.put_line(:OLD.EMP_C_NAME||'yahoo');
    INSERT INTO EMPNAME VALUES (:new.EMP_C_NAME);
    dbms_output.put_line(:OLD.EMP_C_NAME);
    END;
    create table EMPNAME as select * from GLOBAL_TEMP where 1=2
    insert into GLOBAL_TEMP values('fgfdgd');
    commit;
    select * from GLOBAL_TEMP;
    select * from EMPNAME;
    output:
    1 rows inserted
    commit succeeded.
    EMP_C_NAME          
    fgfdgd              
    1 rows selected
    EMP_C_NAME          
    fgfdgd              
    1 rows selectedgot it Arun
    Edited by: OraclePLSQL on Dec 28, 2010 6:07 PM

  • How can I improve the performance of my app?

    Hi,
    I have written an java application. This app makes a large number of calls on a method getting a value from an array. Profling the app reveals that it spends more than 90% of the time in this call. Because the app makes so many calls to this method the app isnt running as fast as it should!!! Can someone tell me how I can improve the performance of the app? Are there any techniques that I can use to improve the performance?

    paul_b wrote:
    I have written an java application. This app makes a large number of calls on a method getting a value from an array. Profling the app reveals that it spends more than 90% of the time in this call. Sounds like you should optimise that call. Either change the code in the call so it is faster or call it less often.
    Because the app makes so many calls to this method the app isnt running as fast as it should!!! It will run faster if you get it to do less work, if it is doing only the work it should do then that is how fast it is.
    Can someone tell me how I can improve the performance of the app? Are there any techniques that I can use to improve the performance?Optimise the code, call it less often, use a server or servers with more resources/CPU.

  • How can we improve the performance while fetching data from RESB table.

    Hi All,
    Can any bosy suggest me the right way to improve the performance while fetching data from RESB table. Below is the select statement.
    SELECT aufnr posnr roms1 roanz
        INTO (itab-aufnr, itab-pposnr, itab-roms1, itab-roanz)
        FROM resb
        WHERE kdauf  = p_vbeln
        AND   ablad  = itab-sposnr+2.
    Here I am using 'KDAUF'  & 'ABLAD' in condition. Can we use secondary index for improving the performance in this case.
    Regards,
    Himanshu

    Hi ,
    Declare intenal table with only those four fields.
    and try the beloe code....
    SELECT aufnr posnr roms1 roanz
    INTO  table itab
    FROM resb
    WHERE kdauf = p_vbeln
    AND ablad = itab-sposnr+2.
    yes, you can also use secondary index for improving the performance in this case.
    Regards,
    Anand .
    Reward if it is useful....

  • How can I improve the performance of my MBP battery?

    Hi, I've had my MBP 2.2GHz for about 2 months and a half now. I use the iStat Pro widget, and it says I've cycled the battery 94 times and the health is down to 92%.
    I've looked up how to optimize the performance and realized I've misused my battery excessively. I use the WI-Fi 95% of the time. I mainly use it for school. This is what a day in use usualy is:
    Charging all night, about an hour of use without power source, half an hour of use connected to the power source, about an hour of use without power source, 40 minutes with power source, and then asleep until I get home and use it usually connected to a power source unless not in my desk.
    I still don't quite get what exactly the cycles mean, but I'll be calibrating the battery soon.
    The question is: How could I optimize the performance to my battery and what habits will make it last longer? Is there any way I could recover the health of it? I plan on buying a new battery soon.

    Welcome to the Forums!
    Actually, you are already using your battery in an optimal manner. Li-based batteries need to be used frequently and 'lightly' (i.e. not fully discharged too often) for best longevity. 92% health after 94 cycles is good (Apple specification is 80% health for 300 cycles).
    You should properly calibrate your battery every 2 months or so:
    http://docs.info.apple.com/article.html?artnum=86284
    For more info on batteries and a what constitutes a cycle, see these pages:
    http://www.apple.com/batteries
    http://www.apple.com/batteries/notebooks.html
    Hope this helps...

  • How can I improve the performance of SSO in BOE XI R2?

    I have SSO AD single sign-on setup for infoview but it takes very long for a user to get into infoview once they select the hyperlink to infoview.  How can I decrease the amount of time it takes a user to get into infoview when having SSO AD configured?

    SSO is actually handled outside of business objects, either challange-response (ntlm,kerberos) or a trusted username (trusted authentication, siteminder, etc) is passed.
    In challange response the client negotiates with AD directly and then a ticket/token is passed to BO for authorization. To verify if the problem is with AD or BO just create an enterprise alias for a slow user, and login manually (after logging out if you don't have any manual links). If it's still slow then the problem is likely with the BO CMS or web/app. IF manual login with enterprise is fast then the problem is likely with AD or the connectivity (DNS, network lag, etc) and should be troubleshot with a packet scanner.
    If it's a trusted connection I will need more details of how it is set up.
    Regards,
    Tim

  • How can I improve the performance of my mpb?

    Hi,
    Just looking for advice on cleaning up a hard drive and improving performance on  an mpb that has slowed to almost a standstill. It is running OSX 10.6.7 and has over 20gigs free...
    Any pointers greatly appreciated

    How big is the MBP drive?  Regardless, using up more than 50% of the capacity will have an effect.  As you fill up the drive, 70-80-90%, the performance decrease will be dramatic.  There are several software applications that you can use to "clean up" and defragment the drive.  I suggest that you evaluate the offerings and suggestions that are part of the "Apple download" section of the website.  I've used Disk Warrior for years, and I find it useful.
    I suggest getting an external drive to hold your less-used data and applications.

  • How can I improve the performance of Apple Remote Desktop?

    Apple Remote Desktop is very slow (refresh of the screen). Hown can I improve speed?

    Like Dave said, you can lower the colors. You can also set a lower screen resolution on the client your connecting to.
    There are things that can slow down ARD. For instance: copying files over the network, Watching youtube, listening to streaming music, Downloading files, video chat, audio chat. Or an active time machine backup running to a time capsul. 
    If you have the option of using your wired network over wireless. And your wired network is faster; then you could try using the wired network.
    If your computer and or the client computer is on wireless, you could try moving the computers closer to the wireless access points. Do the computers have 1 bar , 2 bars, 3 bars or 4 bars in airport menu?
    Are you using ARD at home on a small network? OR are you on a larger buisness network?
    If your on a small home network. You could look at your router to find out if it's 802.11 a, b, g, or n.

  • How can I improve the performance of JWS?

    Hi Friends,
    I have one more problem with JWS.We are launching our AWT/Swing application using JWS but downloading process is very slow. We are using one JNLP file including the reference of multiple jar file So its taking more time in download..........my point of view.
    Pls give ur suggestion what should I do to improve the JWS performance.
    -Dinesh

    No I have tested it without profiler. And I am already working with tomcat, but problem was still same taking more time in starting application and we have refactored code.

  • How can I improve the performance of LOWER (col) LIKE ‘%name%’

    Hi,
    I need to search for this condition:
    WHERE LOWER (col) LIKE ‘%name%’
    In a table with 6,000,000 rows. I understand that when LIKE pattern begins with %, it cannot take the advantage of indexes.
    Is there any technique to improve my query’s performance?
    Thank you,
    Alan

    Last solution is even worse.
    1. IT does the same thing (in a way ) that materialized view can do, except for you can set up materialized view to be auto refreshed (with materialized log, fast commit, etc or scheduled) and this last solution you will have to recreate the table every time you appear to have a new record, in other words you are in a maintenance nightmare (this could have been a solution before 8i)
    2. When you store a rowid in the table column you are asking for spanking........
    a. what will happen to your rowids when you export/import?
    b. enable row movement ?
    c. transition to RAC?
    that's right your rowid formats will change your query won't work.
    With Materialised view you have oracle do all this "maintenance" for you automagically.
    Also as an idea if you say have 2 or 3 queries like that you can create 2-3 mat views and enable rewrite and supposedly it should pick up the right view for you.....
    this is my solution # 3 (besides materialized views and indexes with regular expressions)
    if you are searching word "name" (not a partial string inside other words like zzNAMEsdzz ) then you have many real indexing options (Oracle Text/Intermedia, etc)
    Hope it helps,
    Eugene

  • How can I improve the performance of my iPod touch 2nd gen?

    It is very slow!

    - All you can do is reset the iPod,. Nothing is lost.
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Also periodically power off and then back on the iPod to free up memory.

  • How can you improve the performance of an hp pavillion a6350z?

    Hi, I bought an HP Pavillion a6350z desktop in Feb. of 08. It worked very well  the 1st 3 yrs.,but this past yr. I have had constant problems with it. It is VERY slow. My DSL speed is supposed to be up to 4 MBPS download and I have tested it on many speed test sites and it comes out to actually be .4 MBPS. I have tried a few of those "Optimizing" suites and that hasn't really helped. It is also very unpredictable. At times the page flashes, the screen will suddenly have a white overcast to it, I have flashes of various types and it isn't pop-up ads, although I do get a few of those. Sometimes it will close a page out of the blue. I also have a virus protection suite on it and run that regularly. It doesn't really make a difference. Last June it totally crashed and I had to take it in to a shop to get it repaired. I called my ISP and the tech guy told me maybe a new modem would help. He gave me information on what to look for and get.
    Does anyone have any suggestions for my crazy desktop?
    Thanks,
    jswwi

    Do a system recovery and reinstall the OS.  Backup your data first.

  • How can I improve the performance of my macbook pro?

    My macbook is running really slow. is there a good free way to see if there is something wrong with it?

    Please describe the problem in as much relevant detail as possible. The better your description, the better the chance of a solution.
    For example, if the computer is slow, which specific actions are slow? Is it slow all the time, or only sometimes? When did it start to be slow? Did you change anything just before it started? Have you seen any alerts or error messages? Have you done anything to try to fix it? Most importantly, do you have a current backup of all data? If the answer to the last question is "no," back up now. Ask if you need guidance. Do nothing else until you have a backup.

  • How Can we improve the report performance..?

    Hi exports,
    I am learning the Business Objects XIR2, Please let me know How Can we improve the report performance..?
    Please give the answer in detailed way.

    First find out why your report is performing slowly. Then fix it.
    That sounds silly, but there's really no single-path process for improving report performance. You might find issues with the report. With the network. With the universe. With the database. With the database design. With the query definition. With report variables. With the ETL. Once you figure out where the problem is, then you start fixing it. Fixing one problem may very well reveal another. I spent two years working on a project where we touched every single aspect of reporting (from data collection through ETL and all the way to report delivery) at some point or another.
    I feel like your question is a bit broad (meaning too generic) to address as you have phrased it. Even some of the suggestions already given...
    Array fetch size - this determines the number of rows fetched at a single pass. You really don't need to modify this unless your network is giving issues. I have seen folks suggest setting this to one (which results in a lot of network requests) or 500 (which results in fewer requests but they're much MUCH larger). Does either improve performance? They might, or they might make it worse. Without understanding how your network traffic is managed it's hard to say.
    Shortcut joins? Sure, they can help, as long as they are appropriate. [Many times they are not.|http://www.dagira.com/2010/05/27/everything-about-shortcut-joins/]
    And I could go on and on. The bottom line is that performance tuning doesn't typically fall into a "cookie cutter" approach. It would be better to have a specific question.

  • How can I improve the sound in final cut express using my mic?

    How can I improve the sound in final cut express using my mic?

    I think you're in the wrong forum. This is the LiveType forum. There is no sound in LT.

Maybe you are looking for

  • Problem in displaying Array Position?

    hi, I am having a problem in displaying the array position of a sorted Array for ex: int[] a = {4,3,1,7}for sorting the array i am using Arrays.sort(a); then the output will be a = {1,3,4,7}now according to this i need to display the array position o

  • How to get old itunes back

    itunes 11 ** ***. how do i get the old one back? <Edited by Host>

  • Unable to find database adapter in 10.1.3.1 SOA Suite

    Hi, I have installed 10.1.3.1 SOA suite - Advanced installation. I am not able to find the DbAdapter under the modules section of the JDBC Resources page. What should i do for this? Thanks in advance..............

  • Firefox 21.0 doesn't warn when closing multiple tabs

    I have a Mac OS X, version 10.6.8. I'm using Firefox 21.0. I have the box checked to warn me when closing multiple tabs. It does not. Why? Is there anything I can do to make it work correctly? Any information I've been able to find on the internet is

  • Audio Scrubbing gone in Imovie 09

    In the past I ad sound of my video clips as soon as I scroll with my mouse over a part of the clip. This does not work anymore. It only works if I play the whole clip. Does anybode know where I can turn this on? I tried on the left side of the vu met