Quantcast
Channel: SCN : All Content - SAP Applications on SAP Adaptive Server Enterprise (SAP ASE)
Viewing all articles
Browse latest Browse all 956

Clustered VS Non-clustered index

$
0
0

Hi All,

 

I understand that this is a common question but I felt it will be better to clarify.


I have huge table which consumes 95GB space. It has a clustered index on five columns(ID, Name, ClassName, GroupName and Status). The ID column is an identity column with precision 15 and scale 0. We had duplicate rows issue due to the identity column in this table.

 

For instance, per our business needs we should not allow two rows with the same Name, ClassName, GroupName and Status values. Our ASE server is accessed by another application - dbAnalytics which will insert, update and delete records from our database. When a row is first inserted it will be inserted with the status  inserted. When dbAnalytics tries to update the same record in the database it should update the existing record and change the status column to updated. We have an issue here. The identity column generates a new ID values and inserts the rows as a new record instead of updating the existing one. We do not completely understand how dbAnalytics work, Hence, we are trying to fix this from backend.

 

Due to the issues encountered with the Identity column, we have decided to drop the ID column from the clustered index and recreate it on 3 columns namely - Name, ClassName and GroupName.

 

As per our knowledge, clustered index will arrange the data in sorted order which would help in range queries. Since, we are dropping the ID column which was helping the data in the table to be arranged sequentially, I doubt on performance issues that we may have to encounter in future if we create a clustered index. Since, clustered index always tend to keep the data in sorted order, there is an additional overhead in rearranging the data during inserts or updates.

 

Hence, we are thinking about creating non-clustered index or unique non-clustered index on these three columns(Name, ClassName and GroupName). We have one concern about the performance additional disk needed to navigate to the data page from the index page. We hope this won't have a huge impact.

 

We need help deciding whether we can go with a clustered or non-clustered index based on the analysis detailed above. Please also let us know if there is any other better approch present.

 

Thanks in advance.

 

Regards
ADNAN


Viewing all articles
Browse latest Browse all 956

Trending Articles



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