Temp table, and gather table stats

One of my developers is generating a report from Oracle. He loads a subset of the data he needs into a temp table, then creates an index on the temp table, and then runs his report from the temp table (which is a lot smaller than the original table).
My question is: Is it necessary to gather table statistics for the temp table, and the index on the temp table, before querying it ?

It depends yesterday I have very bad experience with stats one of my table has NUM_ROWS 300 and count(*)-7million and database version is 9206(bad every with optimizer bugs) so queries starts breaking and lot of buffer busy and latch free it took while to figure out but I have deleted the stats and every thing came under control - my mean to say statistics are good and bad. Once you start collecting you should keep an eye.
Thanks.

Similar Messages

  • Difference between Temp table and Variable table and which one is better performance wise?

    Hello,
    Anyone could you explain What is difference between Temp Table (#, ##) and Variable table (DECLARE @V TABLE (EMP_ID INT)) ?
    Which one is recommended to use for better performance?
    also Is it possible to create CLUSTER and NONCLUSTER Index on Variable table?
    In my case: 1-2 days transactional data are more than 3-4 Millions. I tried using both # and table variable and found table variable is faster.
    Is that Table variable using Memory or Disk space?
    Thanks Shiven:) If Answer is Helpful, Please Vote

    Check following link to see differences b/w TempTable & TableVariable: http://sqlwithmanoj.com/2010/05/15/temporary-tables-vs-table-variables/
    TempTables & TableVariables both use memory & tempDB in similar manner, check this blog post: http://sqlwithmanoj.com/2010/07/20/table-variables-are-not-stored-in-memory-but-in-tempdb/
    Performance wise if you are dealing with millions of records then TempTable is ideal, as you can create explicit indexes on top of them. But if there are less records then TableVariables are good suited.
    On Tables Variable explicit index are not allowed, if you define a PK column, then a Clustered Index will be created automatically.
    But it also depends upon specific scenarios you are dealing with , can you share it?
    ~manoj | email: http://scr.im/m22g
    http://sqlwithmanoj.wordpress.com
    MCCA 2011 | My FB Page

  • Reg: Fact table and Dimension table in Data Warehousing -

    Hi Experts,
    I'm not exactly getting the difference between the criteria which decide how to create a Fact table and Dimension table.
    This link http://stackoverflow.com/questions/9362854/database-fact-table-and-dimension-table states :
    Fact table contains data that can be aggregate.
    Measures are aggregated data expressions (e. Sum of costs, Count of calls, ...)
    Dimension contains data that is use to generate groups and filters.
    This's fine but how does one decide which columns to consider for Fact table and which columns for Dimension table?
    Any help is much appreciated.
    Pardon me if this's not the correct place for this question. My first question in the new forum.
    Thanks and Regards,
    Ranit Biswas

    ranitB wrote:
    But my main doubt was - what is the criteria to differentiate between columns for Fact tables and Dimension tables? How can one decide upon the design?
    Columns of a fact table will often be 'scalar' attributes of the 'fact' data item. A dimension table will often be 'compound' attributes of a 'fact'.
    Consider employee information. The EMPLOYEE table can be a fact table. It might have scalar attribute columns such as: DATE_HIRED, STATUS, EMPLOYEE_ID, and so on.
    Other related information that can't be specified as a single attribute value would often be stored in a 'dimension' table: ADDRESS, PHONE_NUMBER.
    Each address requires several columns to define it: ADDRESS1, ADDRESS2, CITY, STATE, ZIP, COUNTRY. And an employee might have several addresses: WORK_ADDRESS, HOME_ADDRESS. That address info would be stored in a 'dimension' table and only the primary key value of the address record would be stored in the EMPLOYEE 'fact' table.
    Same with PHONE_NUMBER. Several columns are required to define a phone number and each employee might have several of them. The dimension tables are used to help 'normalize' the data in the employee 'fact' table.
    And that EMPLOYEE table might also be a DIMENSION table for other FACT tables. A DEVELOPER table might have an EMPLOYEE_ID column with a value that points to a 'dimension' row in the EMPLOYEE dimension table.

  • Oracle Data Compression on SID tables and Dimension Tables

    Hello Community,
    We have had great success with Oracle compression on ODS tables that are no longer loaded.
    We'd now like to move on to other types of BW tables that are very large.
    OSS Note 701235 provides answers to questions concerning the possible use of Oracle compression together with SAP BW.
    But the Note does not give suggestions for (or against) Oracle compression on SID tables or Dimension tables.
    I believe both table types would exhibit the same behaviour : mostly inserts of new SID IDs and new DIM IDs, but few updates to existing SID or Dimension records.  If this is true, then both are good candidates for oracle compression. 
    Do you also agree that this is the typical behaviour for SID tables and dimension tables ?  And that these types of tables are good candidates for Oracle compression in a large BW system ?
    Thanks kindly!
    Keith Helfrich

    Hi all,
    Although this is an old thread I stumbled on during my own investigations I can provide some answers to your questions.
    Table candidates for compression are found by these criteria
           - Table size big enough?
           - Long lifetime of object planned ?
          - No or only rare structural changes for the table   ?
          - u201EUpdateu201C rate low : is your data mostly kind of u201Cread onlyu201D ?
    --               for the wideley used rolling window partition techniques of
                      tables in BW this is not a problem: mostly INSERTu2019s in the
                     current partition not affecting other partitions
    BW tables that can benefit from compression (see SAP notes 105047,701235)
           - PSA tables with data that must be saved for a longer time
           - ODS change log (no Updates of old data, only Inserts of new data)
           - u201Ehistoricalu201C cubes wich get no changes in table structure anymore
    Limitations
             - normal Insert or Update statements are stored ALWAYS in uncompressed
                    format and must be compressed separately ( <= Oracle10g )
             - Slight CPU overhead of compression, butu2026
             --      CPU consumption is more than compensated by doing less I/O as
                   for Bulk loads or parallel processing
             --      SAP BW transformations took a significant amount of CPU for
                       overall load-time into cubes caused by the application server not
                       the database
              - Table must have not more than 255 fields
              - Adding columns with an initial value or dropping columns require
                   uncompression of the complete table (strongest limitation)
    Consider all this above and you can decide that tables that going through UPDATE's are
    not good candidates for compression or tables that can change it's structure (like
    Fact- or DIM tables) .
    Now, my questions to you:
    Wich Oracle version do you use?
    Wich tool do you use for  Oracle compression?
    BRspace (can you give an example ?)
    ALTER ... MOVE COMPRESS
    bye
    yk

  • How can I get data in flat file from Pool table and cluster table ?

    Hi,
    I am working in one Achiving project. My requirement is to get data into flat file from Cluster table and pool table.
    Is there any tool avilable to download data into flat file from pool table and cluster table ?
    if table name given in the selection screen then data will be downloaded into flat file.
    waiting for quick response.
    Best Regards,
    Bansidhar

    Data cannot be retrived directly form the cluster table
    as the Cluster results are stored in Cluster Key say for example PCLkey
    and form that Key we need to fetch the data
    these clustes are not the part of PNP or PNPCE tables
    for ur info kindly check

  • Fact Table and Dimension Tables

    Hi Experts, I'm creating custom InfoCubes for data coming from non-SAP source systems. I have two InfoCubes. Tha data is coming from like 10 tables. I have 10 DataSources created fo this and the data will be consolidated in Standard DSO before it will flow into 2 InfoCubes.
    Now client wants to know before how much data will be there in InfoCubes in Fact table nad Dimension tables in both the InfoCubes. I have the total size of all the 10 tables from the sources given to me by the DBA. I wan not sure how I can convert that info for Fact table and Dimension table as I have not yet created these Infocubes.
    Please help me with this on how I should address this.

    hi,
    The exact data will be hard to give however you can reach at a round figure in your case.
    You are consolidating the data from the tables that means that there is relation between the tables. Arrive at a rough figure based on the relation and the activity you are performing while consolidating the data of the tables.
    For example, let us say we want to combine data for sales order and deliveries in a DSO.
    Let Sales order has 1000 records and Delivery has 2000 records. Both the tables have a common link (Sales Order).In DSO you are combining the data that means the data will be at the most granular level consist of Delivery data, so the maximum no of records which the consolidated DSO can have is 2000.
    regards,
    Arvind.

  • DATA BASE TABLE AND INTERNAL TABLE

    Dear Friends,
    please help me out in getting complete information about database table and internal table.
    you can email me at < Removed by moderator - please maintain e-mail iDs in Business Card>
    Message was edited by:
            Arun Varadarajan

    Hi Hazi,
    <b>DATABASE Tables :</b>
    This are the tables which are stored in the database (eg Oracle , informix , DB2 etc..) Physically. u can view it from T-codes SE11 or SE16. here in SE11 u can create ur own Transparent table.
    for more information...
    http://www.sapbrainsonline.com/TUTORIALS/TECHNICAL/dictionary_tutorial.html
    <b>Internal Tables.</b>
    While generating reports or other objects we are not modifying the database tables directly first we are selecting the data of the database table into the internal tables... so that we can reduce the database access time and network traffic .. which is highly needed in R/3 system..
    internal tables are not exist phyiscally in the system. its like a array. the existance of the internal tables is upto the program execution in which u r declaring nd using it...
    for more information..
    http://www.sapbrainsonline.com/TUTORIALS/TECHNICAL/internaltables_tutorial.html
    Hope it will solve ur problem..
    <b>Reward points if useful..</b>
    Thanks & Regards
    ilesh 24x7

  • Check table and value table -Example

    Hi Experts
                  Please give me the step by step procedure to create the check table and value table, and how to work on it.
    Thanks in advance.
    Regards
    Rajaram

    Hi
    Check Table is for Field level Validation whereas Value table is for Domain Level Validations.
    Value Table proposes table for check table.
    I think you are clear with this.
    more elaborate.
    Check Table
    The Check Table is the table used by system to check if a data exist or not exist.
    While creating a table if you want to be sure that a field can have some values
    and these are in a certain table, you can give IT this table as CHECK TABLE.
    Value Table
    This is maintained at Domain Level.
    When ever you create a domain , you can entered allowed values. For example you go to Domain SHKZG - Debit/credit indicator.
    Here only allowed values is H or S.
    When ever you use this Domain, the system will forces you to enter only these values.
    This is a sort of master check . .
    To be maintained as a customization object.
    This mean that if you want to enter values to this table you have to create a development request & transport the same.
    Differences:
    1)check table will carry out the check for input values for the table field being entered in any application
    and value table will provide values on F4 help for that table field.
    2)The check table defines the foreign keys and is part of the table definition.
    The value table is part of the domain definition.
    check table is validation at field level.
    value table is at domain level.
    Value table is defined at the domain level and is used to provide F4 help for all the fields which refer to that domain.
    Check table is defined against a field in SE11 if you want the values in that field to be checked against a list of valid values. For e.g. if you are using the field matnr in a table you could define MARA as the check table.
    Also while defining a check table SAP proposes the value table as check table by default. Referring to the previous example if you tried to define a check table for the matnr field SAP would propose MARA as the check table.
    1. what is the purpose / use ?
    -- so that the user can select values
    from some master table , for that field !!!!
    2. This is done by
    CHECK TABLE (foreign key concept)
    (and not value table)
    3. When we create a check table for a field,
    then
    some DEFAULT table is PROPOSED
    4. that DEFAULT table is nothing
    but PICKED up from the domain of that field,
    and shown from the value of VALUE TABLE.
    CHECK TABLE -it is a parent table.
    for example..
    i have two tables ZTAB1 and ZTAB2.
    I have one common field in both the tables,i can make any ztable to be the check table .If i make Ztab1 to be the check table then when i have to make an entry in ztab2 i will check whether ztab1 is having that value or not..
    its also field level checking..
    Valuetable-It is nothing but default check table.
    one parent can have n number of child tables.For example
    For ztable we have zchild1 and zchild2 tables r there.
    Its domain level checking..When zchild2 uses the same domain as used by zchild1 then the system automatically generates a popup saying a check table already exists would u want to maintain it.
    go to domain and then press the value tab u can see the valuetable at the end...
    Please refer the links below,
    d/r b/n check and value table?
    wjhat is the exct difference between check table and value table
    what is the check table and value table
    check table and value table
    Re: wjhat is the exct difference between check table and value table
    http://www.sap-img.com/abap/difference-between-a-check-table-and-a-value-table.htm

  • Inforation on Pool tables and cluster tables required.

    I want to know about the pool tables and cluster tables like how to create them and how to look the tables associated with the given tables. Like for the table BSEG we have other tables linked BSID etc. I'm new to this concept please guide me.

    <b>Pooled Table:</b>
    A pooled table in R/3 has a many-to-one relationship with a table in the database (see Figures 3.1 and 3.2). For one table in the database, there are many tables in the R/3 Data Dictionary. The table in the database has a different name than the tables in the DDIC, it has a different number of fields, and the fields have different names as well. Pooled tables are an SAP proprietary construct.
    When you look at a pooled table in R/3, you see a description of a table. However, in the database, it is stored along with other pooled tables in a single table called a table pool. A table pool is a database table with a special structure that enables the data of many R/3 tables to be stored within it. It can only hold pooled tables.
    R/3 uses table pools to hold a large number (tens to thousands) of very small tables (about 10 to 100 rows each). Table pools reduce the amount of database resources needed when many small tables have to be open at the same time. SAP uses them for system data. You might create a table pool if you need to create hundreds of small tables that each hold only a few rows of data. To implement these small tables as pooled tables, you first create the definition of a table pool in R/3 to hold them all. When activated, an associated single table (the table pool) will be created in the database. You can then define pooled tables within R/3 and assign them all to your table pool.
    Pooled tables are primarily used by SAP to hold customizing data.
    <b>Cluster Table:</b>
    A cluster table is similar to a pooled table. It has a many-to-one relationship with a table in the database. Many cluster tables are stored in a single table in the database called a table cluster.
    A table cluster is similar to a table pool. It holds many tables within it. The tables it holds are all cluster tables.
    Like pooled tables, cluster tables are another proprietary SAP construct. They are used to hold data from a few (approximately 2 to 10) very large tables. They would be used when these tables have a part of their primary keys in common, and if the data in these tables are all accessed simultaneously.
    Table clusters contain fewer tables than table pools and, unlike table pools, the primary key of each table within the table cluster begins with the same field or fields. Rows from the cluster tables are combined into a single row in the table cluster. The rows are combined based on the part of the primary key they have in common. Thus, when a row is read from any one of the tables in the cluster, all related rows in all cluster tables are also retrieved, but only a single I/O is needed.
    A cluster is advantageous in the case where data is accessed from multiple tables simultaneously and those tables have at least one of their primary key fields in common. Cluster tables reduce the number of database reads and thereby improve performance.
    Restrictions on Pooled and Cluster Tables
    1. Pooled and cluster tables are usually used only by SAP and not used by customers, probably because of the proprietary format of these tables within the database and because of technical restrictions placed upon their use within ABAP/4 programs. On a pooled or cluster table:
    2. Secondary indexes cannot be created.
    3. You cannot use the ABAP/4 constructs select distinct or group by.
    4.You cannot use native SQL.
    5.You cannot specify field names after the order by clause. order by primary key is the only permitted variation.
    For creation of pooled /cluster table, have  a look at below link.
    http://help.sap.com/saphelp_erp2004/helpdata/en/81/415d363640933fe10000009b38f839/frameset.htm
    For creation of table pool /cluster, have  a look at below link.
    http://help.sap.com/saphelp_erp2004/helpdata/en/81/415d363640933fe10000009b38f839/frameset.htm
    Have a look at below link.
    http://www.sap-img.com/abap/the-different-types-of-sap-tables.htm
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • Number of Entries in Dimension Tables and Fact Tables

    Hi all,
    is there an easy way to check
    - the number of entries in the dimension tables
    - the number of entries in the fact table?
    Thanks  a lot
    Alex

    Hi Alex,
    If u want to see the content of Dimension table and Fact table for a infocube then just right click on a particular info cube then select manage . Select coneten tab there , form there u can either select Fact table to see the fact table conten or Infocube content to see the Dimensiontable content.
    Regards..

  • Fact table and dimension table

    what is the difference b/w fact table and dimension table

    A fact table contains numeric values and also contain composite key(i.e collection of foreign key) e.g.. sales and profit. Typically has two types of columns: those that contain facts and those that are foreign keys to dimension  tables.
    Dimension tables, also known as lookup or reference tables, contain the relatively static data in the warehouse. It contains character values E.g Customer_name,Customer_city.
    Dimension tables store the information you normally use to contain queries. Dimension tables are usually textual and descriptive and you can use them as the row headers of the result set.
    Rachna

  • Sizeof fact table and dimension table

    Hi Experts ,
    Can you tell me how to measure the size of dimension table and fact tables and how to find the ratio of size of dimension table to the size of fact table.
    Thanks in advance,
    Thanks and Regards
    Ram Kommineni

    Hi,
    The ratio of size of fact table to dimension table is ideally should be 10:1. That means the size of the dimension tables should be 10% of the size of the fact table. This serves better in terms of performance.
    Whenever you load any cube, you can easily find out the number of records in fact table (E and F table) and the dimension tables. Based on that statistics you can determine the ratio of size in fact and dimension tables.
    Hope this info helps you.
    Regards,
    Yogesh.

  • To find the size of the fact table and dimension table

    Hi experts,
    Can anyone plz tell me if i want to find size of the fact table and size of the dimension table to find cardinality and line item do we first build statistics then find size by transaction DB02 or any other method we have?
    Thanks in advance

    Hi ,
    Please go to Tcode DB02 >Space>Table and Indexes.Give your table name or pattern (like /BIC/F* for gettinf all the Fact tables)
    .This will give you sizes of all the table.
    Also if you want to get list like TOP 30 Fact tables and Dimension Table.Please use TCode ST14, this will give a desired output with all the required details.
    -Vikram

  • What is FACT table and FLAT table?

    Hello,
             Kindly tell me what is mean by FACT table and FLAT table and how it is use in the BI system ?also tell me can i see these table in the system ?if yes then please tell me the procedure to see the content of the FACT and FLAT table.   And also tell me about the SID table and how to see it.

    Cube consists of Fact tables and Dimension tables.
    The structure of these tables are "Flat".
    Cube consists of two factables... 'F' - Fact table and 'E' - Fact table.
    The naming convention will be..
    /BIC/F<..Cube name..>   for F Fact table
    /BIC/E<..Cube name..>   for E Fact table
    Eg: for cube "EMPLOYEE" the names are..
    /BIC/FEMPLOYEE
    /BIC/EEMPLOYEE
    The dimention tables have naming convention..
    /BIC/D....
    You can check these tables in SE11 or you can use the transaction LISTSCHEMA and then provide the Cube name.
    SID's tables are used to link the master data with the dimention tables.

  • Reg value table and check table

    Hi Friends,
        I have defined a value table(ZVALTAB) for a domain and defined the relation ship between check table(ZCHKTAB) and dependent table(ZDEPTAB). Here value table and check table both are different. My problem is while I am entering the values into check table, it is not restricting the values to enter into check table even those values are not in value table. And while I am entering values into the dependent table through the menu option Utilities->Create entries then also foreign key is not working. But when I use the SM30 then the foreign key is working. So can any body explain me when this value table restrict the values and why the option Utilities->Create entries is not validating the foreign key relation ship.
    Sathish Reddy

    Hi,
      Value Table will just provide you the possible set of values.  It won't restrict u for the wrong entries.  Moreover whenever u enter entries thru Create entries no user interface is available.  The constraints whatever we give is not at all stored in the Data Dictionary.  Only the user interface which takes care all about this.  Hence it wont restrict you.  For this u have to create table maintenance generator for your table.  Then it will restrict the values against check table.
    Both Value table and Check table will provide u possible set of values.  But only the check table will restrict the values.
    Hope this will help u.

Maybe you are looking for

  • PL/SQL if statement inside tabledata in another table

    if following possible???: htp.tableData( htf.tableOpen || htf.tablerowOpen || htf.tableData() || htf.tablerowClose || --here i want a if statement; --is this possible abd how? --if 1 = 1 then htf.tablerowOpen || htf.tableData() || htf.tablerowClose |

  • No joins found where required

    We were using Disc 9i(db is 8i) and now it is migrated to Disc 10g(db is 9i). After migrating it gives 'No joins found where required'. Actually there is no joins with that folder. Joins Activity in workbook/worksheet question says applying patch 499

  • No horns in garageband for ipad 2?

    Where are the horns in garageband for the ipad?

  • Calling dll file to control a third party board from PC Control.

    Hi there, I have this hawkeye stepper motor control board from PC control company.  It comes with a software written by the company  which is in DLL format. I would like to call the DLL file in labview and be able to do further programming on it usin

  • How can I disable my USB port?

    I need to temporarly disable my USB ports on my powerbook.