Hi Agus

Yes, you can override the placement of the dataAreaId field in indexes. To do 
this, simply manually add the dataAreaId as a field in an index (right click on 
the index and click New Field. Open the properties form for the new field then 
select DataAreaId as the field). Once you've done this you can move the field 
anywhere within the index just like a "normal" field and AX is smart enough to 
not add another dataAreaId field to the front of the index.

The reason why you'll find that the tuning advisor often recommends this kind 
of thing is that it can make the index more efficient. Typically indexes work 
better when the most unique (i.e. those with the most variation in value) are 
at the front of the index. So long as you're careful to ensure that any index 
modified in this way will always have all of the fields in the index that are 
placed in front of the dataAreaid included in your selects you'll be fine. Even 
if that's not possible, you can always create another index to support those 
selects.

I wouldn't recommend always doing what the tuning advisor says but if you do a 
trial with the index changed and test for a genuine performance improvement 
(which means you need to know where in the Ax code the selects are coming from) 
then it can be a useful tool.


Malcolm Burtt
Touchstone Group
People - Partnership - Solutions



From: Axapta-Knowledge-Village@yahoogroups.com 
[mailto:axapta-knowledge-vill...@yahoogroups.com] On Behalf Of Agus Riyadi
Sent: 04 March 2009 07:27
To: axapta-knowledge-village
Subject: [Axapta-Knowledge-Village] Create index with first column not 
dataareaid


Dear all,

Using sql server database engine tuning advisor, I got a recommendation to add 
new index with the following scheme :

CustPackingSlipJour :
          salesid asc,
          dataareaid asc,
          recid asc.

Is it possible to achieve that in Ax ? As far as I know Ax always add 
dataareaid column as the first column of any index created from AOT.

Thanks and best regards,

Agus

Reply via email to