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

Generally I'd expect that one "alter table" would be quicker than two.

 

However, with your case there may be a reason why there's little difference (and its a guess)

 

You're adding 2 bit fields.

Is the OR_N the first bit field on the table ?

If so, then the server will allocate 1 byte for the bit (as thats the smallest unit of storage).

But, the second bit field OR_S doesn't need any storage as it will "piggy-back" off the OR_N field.

(This will continue for the next 6 bit fields and the 9th bit field will allocate another byte)

 

All it has it do is to AND the field to make the values 0 for this bit.

It would be interesting to see the time to run the first alter table and the time to run the second alter table separately.

 

As I said only a guess.

 

Also check the amount of disk reads are being done.

If it has to read all the data off disk, (say 6GB) then at 5ms per 16k page would take 43 mins just to read the data. The second alter table could read from cache and take just a couple of mins.


Viewing all articles
Browse latest Browse all 3587

Trending Articles



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