1 complex insert or multiple updates

ajayjainajayjain Member Posts: 119
Hi,

I need to consolidate G/L entry table for 16 companies
records are in millions
I have written Insert into Select query with lots of Join statement where I am calling G/L account name, etc from other tables into 1 new consolidated table

It works fine but to speed up
should I simply insert only g/l entry fields first and then update with g/l account name, dimensions,period etc
or
1 big insert will be better


Thanks
Ajay Jain
UK

Comments

  • KishormKishorm Member Posts: 921
    I suspect the 2nd option would be faster - shouldn't take you long to test this out seeing as you already have the 1st option working. Give it a go and post back and let us know the results.
  • bbrownbbrown Member Posts: 3,268
    Also to help speed things up:

    1. Export original table object
    2. Disable SQL maintenance of all secondary keys and Sumindexs
    3. Do your import. Not having to update the above for each record will help speed it up.
    4. Then re-import the original table object to recreate the keys etc.

    There are no bugs - only undocumented features.
  • bbrownbbrown Member Posts: 3,268
    Note: If your joins depend on some of the secondary keys, then leave only those enabled. But disable any SumIndexes they have.
    There are no bugs - only undocumented features.
  • ajayjainajayjain Member Posts: 119
    Thank you KishorM and bbrown :smile:
    Ajay Jain
    UK
Sign In or Register to comment.