Statistics Analysis on Tables that are often empty

Right now I'm dealing with a user application that was originally developed in Ora10g. Recently the database was upgraded to Ora11g, and the schema and data was imported successfully.
However, since the user started using Ora11, some of their applications have been running slower and slower. I'm just wondering if the problem could be due to statistics.
The application has several tables which contains temporary data. Usually these tables are empty, although when a user application runs they are populated, and queried against, and then at the end the data is deleted. (Its this program that's running slower and slower.)
I'm just wondering if the problem could be due to a problem with user statistics.
When I look at the 'last_analyzed' field in user_tables, the date goes back to the date of last import. I know Oracle regularly updates statistics, so what I suspect is happening is that, by luck, Oracle has only been gathering statistics when the tables are empty. (And since the tables are empty, the statistics are of no help in optimizing the DB.)
Am I on the right track?
And if so, is there a way to automatically trigger a statistics gather job when a table gets above a certain size?
System details:
Oracle: 11gR2 (64 bit) Standard version
File System: ASM (GRID infrastructure)

Usually these tables are empty, although when a user application runs they are populated, and queried against, and then at the end the data is deletedYou have three options (and depending on how the data changes, you might find that not all temporary tables work best with the same option) :
1. Load representative data into the temporary table, collect statistics (including any histograms that you identify as necessary) and then lock the statistics
2. Modify the job to re-gather statistics immediately after a temporary table is populated
3. Delete statistics and then lock the statistics and check the results (execution plan and performance) when the optimizer uses dynamic sampling
Note : It is perfectly reasonable to create indexes on temporary tables -- provided that you DO create the correct indexes. If jobs are querying the temporary tables for the full data set (all rows) indexes are a hindrance. If there are many separate queries against the temporary table, each query retrieiving a small set of rows, an index or two may be beneficiial. Also some designs do use unique indexes to enforce uniqueness when the tables are loaded.
Hemant K Chitale

Similar Messages

  • How to know the List of Tables that are updated through a ABAP Program

    Hi,
    Is there a program or something that will help me to identify the List of Tables that are used in a ABAP program(ABAP Report, Transaction .... program) without debugging it or looking at the dictionary structure.
    I really need this urgently. Try to give me many methods as possible.
    Thkx
    Kishan

    Hi,
    I created a Z-transaction for my SE49 and debugged a little bit - it's not so fantastic any longer - just like the proposal of SE80 - DDIC list.
    SE49 (and I guess similiar functions, too) just scan the source code for a list of key words: tables, select, update, insert, modify, export, import.
    But very (very!) often updates are encapsulated into function modules - and here this technical cross reference (just like SE80 DDIC list) is of no help.
    So a SQL trace (or runtime analysis) is still the best option to get a complete list. Still these tools just analysis one process - if in other circumstances more tables are involved, can't be judged.
    E.g.:
    - creating one new entry: 1 table
    - changing existing entry: 2 accesses to 1 table + log table
    Regards,
    Christian

  • Re : The Tables that are linked in SAP R3 Datasource

    Can any one mention what are the tables that are link to the sap data sources
    For Eg : 2LIS_11_VAHDR for the given data source what are the tables that are linked , where exactly the theses tables are stored in the database

    Hi,
    You can get this information from SAP documentation.Please check the below link.
    http://help.sap.com/search/highlightContent.jsp
    Regards,
    Raju

  • Is there a way to find the temporary table that are created or read during?

    Hi All,
    I'm working on performance optimization where I have to find the temporary tablespaces that are created or read during runtime? Is there any way to find it?
    Can you please also tell me how the temporary tables are created? And after each run time whether the data is getting deleted or the whole table is getting deleted?
    Whether these tables are created only during runtime? What are the naming conventions for all the temporary tables that are created?
    Is the table creation has anything to do with Delta or Full load?
    Regards,
    Kartik

    Stephen Tyler Bloom wrote:
    When they come out with the next garageband, they should add that feature .
    be sure to let Apple know:
    http://www.bulletsandbones.com/GB/GBFAQ.html#sendfeedback
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • Can I create tables that are subsets of my master table?

    I would like to create tables (or sheets) that are subsets of the master table so that I can view different subsets of data in smaller chunks. I would like to continue to enter data in the master - and have it reflected in the subsets. Possible?
    Thank you

    Would this do what you want?
    Create a table for your subset of info. In its first cell, enter "=" & then click on the cell in the master table that you want displayed in that cell of the new table. You will get a formula of the type:
    =Table 1 :: B2
    where "B2" will be whatever cell you clicked on in Table 1.
    You can extend this formula downward or rightward with the circular blue fill handle to easily display adjacent row or column cells from the master table. You can also repeat the process starting with a new cell in the new table to display as many or as few cells of the master as you want. (You could even display different row or column values from the master in the same row or column of the new table, but I'm not sure that would be of any use.)
    Once you get the subset table set up as you want, lock it so that you cannot accidentally change its cell contents to something else.
    The result is a table slaved to the master which will automatically show any changes to the master but otherwise cannot be altered. This table can also be copied to other sheets & the formulas will be updated with the sheet reference automatically.
    The only drawbacks to this approach that I know of are that you can't enter data into the subset table (which may be a good or bad thing) & that empty cells in the master will be represented by zeros in the subset table. An 'IF(ISBLANK())" formula addition would take care of that but may not be needed.

  • Records in a table that are not older than two weeks

    Hey everyone,
    I have a mysql table which has a column DATE which contains the date the enty was inserted
    I need to write a script which keeps only those records that are no older than two weeks.
    Can this be done in sql?
    I can do it in Java but I guess this is not the most efficient way.
    I use jsp and servlets in my app.

    I just tried out the above code:
    DELETE FROM myTableHere  WHERE DATE_SUB(CURDATE(),INTERVAL 14 DAY) <= DATE;This is the error that I got:
    mysql> DELETE FROM myTableHere WHERE DATE_SUB(CURDATE(),INTERVAL 14 DAY) <= DATE;
    ERROR 1054 (42S22): Unknown column 'DATE' in 'where clause'
    mysql>
    my sql table has the currentDate column which specifies the current date and time when this entry was inserted into the DB. To get current date and time I use 'now()' function of sql.
    what is the problem?
    Thanks.

  • Two columns in the same table that are foreign keys to the same master key

    i want to create a table let say X, which have two columns that are foreign key that reference the same column in the master table, so does this count as bad database design.

    here is the full ddl for the two table, where in the second table there are two columns that represent the primary key and they are also two foreign keys to the same columns in the master table (items)
    Desc item table;
    Item_id
    Item_name
    Item_price
    Item_quantitiy
    Create table item_recommendation ( item_id varchar(20), recommended_item varchar(20),
    CONSTRAINT recom_primary PRIMARY KEY (item_id, recommended_item),
    CONSTRAINT F1 FOREIGN KEY (item_id) REFERENCES items(item_id), ),
    CONSTRAINT F2 FOREIGN KEY (recommended_item) REFERENCES items(item_id));

  • Select multiple row in a table that are not connected

    I want to be able to select multiple rows, but want to be able to select rows that are not next to each other. They maybe have one or two rows between. Is there anyway to do this in a table?
    Thanks

    So do a lot of other people, but you can’t.
    Tell Adobe here: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    Bob

  • Tables that are frequently deleted

    I was wondering if anyone out there had some suggestions on how to deal with this problem.
    We have a participants table that stores all the participants in a program.
    During an enrollment period we may have several thousand new participants that may choose to enroll in a program.
    After enrollment we delete all the participants who haven't enrolled in a program.
    Should I create a separate table called new_participants and just truncate it after each enrollment, or should we leave all records in the same table and delete unused records after enrollment?

    truncate is an option if performance is becoming a problem and there are a large number of full table scans from the application. Otherwise, this is not requried.

  • Creating FK's in tables that are all ready created

    Good afternoon,
    I have 4 tables set up, and need to create foreign keys in three on them relating back to my EMPLOYEE table. The FK will be based on the employee number column in the EMPLOYEE table.
    Once these tables are created and populated, how do I link a PK to a FK, and how do I create a FK in a table that is already created.
    Many Thanks,
    -Robert

    Hello Robert,
    you can do that with APEX as well:
    1. Login to your workspace
    2. Go into "SQL Workshop"
    3. Start the "Object Browser"
    4. Select "Tables" (if not selected already)
    5. Pick your desired table (e.g. CONSULTING) from the table list
    6. Click on "Contraints" in the detail view
    7. Click on "Create"
    8. Enter your desired Contraint Name (e.g. CONSULTING_FK)
    9. Chose your desired Contraint Type (e.g. Foreign Key)
    10. Chose your option for action on delete for that key (see lakes post above)
    11. Chose the column that contains the foreign key (e.g. Cnslt_Emp)
    12. Chose the table to be referenced (e.g. EMPLOYEE)
    13. Chose the column to be reference (e.g. Emp_Num)
    14. Continue
    15. Check if all settings are correct, see the SQL statement if you want, and click Finish.
    To learn more about what you can do with the Object Browser and the other components in the SQL Workshop, you might want to study the [url http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15520/toc.htm]APEX SQL Workshop Guide. It contains step-by-step guides for almost all functionality you'll need in every day life.
    -Udo

  • Managing Cisco Devices That Are Often Offline

    In my environment, there are remote network devices that are turned on/off on an as-needed basis. Since we can't know when they'll be on the network, they cause failure alerts in Ciscoworks ( say RME tried to inventory them while they are offline ). Is there a best practice for handling this case? My idea is to create a user group of devices that are excluded from schedule inventory/configuration backups so that we can prevent the alerts.from being generated. However, I don't know if CiscoWorks has this capability .

    Hi
    Couple of things spring to mind
    1) DNS resolution. How do you resolve the hostnames for your routers/switches now ?. if you do it via DNS then you need to update it to reflect the new name.
    2) Any scripts etc. that you may use to automate taks on your network may need updating although if they use DNS to resolev just see 1
    3) SSH. If you are using SSH to manage your routers/switches and you change the hostname the ssh key will become invalid. You will need to regenerate the key.
    HTH
    Jon

  • T-SQL - Using Column Name in where condition without any references when having multiple tables that are engaged using multiple joins.

    Hi All,
    I am a newbie for T-Sql, I came across a SP where multiple tables are engaged using multiple joins but the where clause contain  a column field without any table reference  and assigned  for an incoming variable,like 
    where 'UserId = @UserId'
    instead -  no table reference like 'a.UserId = @Userid'   ............ Can any please do refer to me any material that clears my mind regarding such issue................... help is appreciated.
    Thank You.

    As suggested above, use table alias with columns for unique referencing and to make the code easier to read.
    BOL example for table aliasing:
    USE AdventureWorks;
    GO
    SELECT S.CustomerID, S.Name AS Store, A.City, SP.Name AS State, CR.Name
    AS CountryRegion
    FROM Sales.Store AS S
    JOIN Sales.CustomerAddress AS CA ON CA.CustomerID = S.CustomerID
    JOIN Person.Address AS A ON A.AddressID = CA.AddressID
    JOIN Person.StateProvince SP ON
    SP.StateProvinceID = A.StateProvinceID
    JOIN Person.CountryRegion CR ON
    CR.CountryRegionCode = SP.CountryRegionCode
    ORDER BY S.CustomerID ;
    GO
    GO
    LINK:
    http://technet.microsoft.com/en-us/library/ms124824(v=sql.100).aspx
    Check the use of TABLE ALIASes and COLUMN ALIASes in the following blog:
    http://www.sqlusa.com/bestpractices2005/organizationtree/
    Without the use of aliases the code would become unreadable.
    Kalman Toth Database & OLAP Architect
    Free T-SQL Scripts
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • How to find all tables that are associated with a given domain name.

    I want to find all table, excluding the structures, of a given domain name, say, waers.
    Some of the tables are directly contains the domains while others are related with a data element which is connected to that domain.
    I want to find tables for all two case -either tables connected directly to the domain or connected via data element- and exclude the structures.
    thanks in advance.

    Hi,
    The following thing may help you.
    in se11-> search for tables having names like 'DD*'.
    From this list of tables you can find the required table to get domain, data element nad table name.
    one way of doing it:
    SELECT rollname domname
      FROM dd04l
      INTO CORRESPONDING FIELDS OF TABLE it_tab.
    SELECT rollname tabname
      FROM dd03l
      INTO CORRESPONDING FIELDS OF TABLE it_tab1
      FOR ALL ENTRIES IN it_tab
      WHERE rollname = it_tab-rollname.
    SORT it_tab1.
    DELETE ADJACENT DUPLICATES FROM it_tab1.
    LOOP AT it_tab1 INTO wa_tab.
      MODIFY it_tab FROM wa_tab
      TRANSPORTING tabname
      WHERE rollname = wa_tab-rollname.
    ENDLOOP.
    LOOP AT it_tab INTO wa_tab.
      WRITE:/ wa_tab-domname,
              wa_tab-tabname.
    ENDLOOP.
    Regards,
    Manoj Kumar P

  • Unable to Move Parts of a Table that are LOB's

    Hello -
    I'm running Oracle 8.1.7.4. I moved a table from one tablespace to another by issuing the following command:
    alter tableA move tablespace SomeTS;
    I noticed that the table now resides in SomeTS, but the LOB data types still reside in the OldTS. Is there a relatively easy way to get the LOB segments in new tablespace?
    Thx.

    The statement "alter tableA move tablespace SomeTS;" will rebuild the table tableA segment, but will not rebuild the lob segments of your lob column (e.g lobA).
    You need the following syntax to move the tables and its LOB column.
    ALTER TABLE tableA MOVE
    TABLESPACE SomeTS
    LOB (lobA) STORE AS (TABLESPACE SomeTS);
    Since you have already moved the table, you can move only the LOB column with this syntax
    ALTER TABLE tableA MOVE LOB(llobA)
    STORE AS (TABLESPACE SomeTS);

  • How to check Tables that are used in request submitted

    Hi All
    I need to check the tables from where Apps is extracting data when I am submitting my requests in different modules.
    Response is appreciated.
    Alok

    It is easy one. Just switch sql trace for a particular CR in the CR definition form.
    Run CR then. And find all SQL that have been run in TRC file located on the DB server.
    Yury

Maybe you are looking for

  • Adding Images to Web Gallery

    After my Web Gallery is uploaded and I get additional images from subsequent shoots, I'd like to import and add them to the slideshow, then to the Web Gallery without having to re-type the Web Gallery info into the boxes again. Any way to accomplish

  • Disappearing canvas

    I have three canvases on my form :- Canvas A is a content canvas Canvas B is a tab canvas Canvas C is a stacked canvas When i move focus from canvas C to canvas B, canvas C disappears. What could be causing this disappearance? Please assist. Edited b

  • Virtual Private Database and BC4J

    How do I designate CLIENT_IDENTIFIER in Global Application Context on the database using BC4J ?

  • Ssis 2012: deployment heartburn

    Has anyone seen a symptom when creating an SSIS job step, the environment checkbox is unavailable and the connections are still tied to a previous environment even though the ssisdb catalog is there with the environment settings in place. as an aside

  • ADF: Page navigation and buttons stop working after a while

    Hi all, We have a web app built with ADF Faces/JDev 10.1.3 that runs in OC4J 10.1.2.0.2. Sometimes we encounter this problem in our JSF pages: after a while (can't relate to some particular action), all navigation in a page (links, tabs, buttons, etc