Quantcast
Channel: SCN: Message List - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 3587

Re: Multiple Alter Table Statements in one batch

$
0
0

I've done some tests on this ...

and I get different results to you....

 

Using a table of 1,000,000 rows with no indexes and

     adding 2 columns at once took about 4s

     adding 2 columns with 2 commands took about 7s

So better to do it in one command

 

Using a table of 1,000,000 rows with a single index and

     adding 2 columns at once took about 9s

     adding 2 columns with 2 commands took about 15s (8s + 7s)

Still better as one command

(Note : lots of rounding in these )

 

 

If the data is flushed out of cache then the times increase by 50%.

Adding 2 columns with 2 commands took about 21s (14s + 8s)

 

The first alter table gets everything off disk and the second doesn't touch the disk so much faster.

 

I suspect you will see the same effect.

 

BTW, I also ran this on a 35m row table with 1 index and it took 9 minutes which is substantially faster than your run. What hardware are you using ? What disks are you using ?


Viewing all articles
Browse latest Browse all 3587

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>