Results 1 to 4 of 4

Thread: DB2 runstats

  1. #1
    Join Date
    Nov 2013
    Posts
    26

    Unanswered: DB2 runstats

    Hello, We are inserting data into 9.5 on AIX through Datastage. After runstats, the data being inserted was fast. It's been 3 weeks since runstats has been done and the new set of inserts have already been started. The inserts are very slow now and I want to do runstats with 'allow write access'. As per IBM's documentation,

    ===
    ALLOW WRITE ACCESSSpecifies that other users can read from and write to the tables while statistics are calculated. For statistical views, these are the base tables referenced in the view definition.
    The ALLOW WRITE ACCESS option is not recommended for tables that will have a lot of inserts, updates or deletes occurring concurrently. The RUNSTATS command first performs table statistics and then performs index statistics. Changes in the table's state between the time that the table and index statistics are collected might result in inconsistencies. Although having up-to-date statistics is important for the optimization of queries, it is also important to have consistent statistics. Therefore, statistics should be collected at a time when inserts, updates or deletes are at a minimum.
    ===

    In our case, there are no other applications using those tables except this Datastage job doing sequential inserts. Is it a good idea to do runstats in our scenario?

    Thanks

  2. #2
    Join Date
    Nov 2013
    Posts
    26
    sorry. Just to clarify, tables I'm talking about are fact and dimension tables.

  3. #3
    Join Date
    Sep 2013
    Location
    India
    Posts
    246
    In case of huge amount of inserts runstats in between is not recommended. Try to split your insert load in 3-4 batches with runstats in between, if runstats is the only solution.
    ssumit

  4. #4
    Join Date
    Nov 2013
    Posts
    26
    Thank You. Will also check the nleaf and nlevels after the stats.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •