简体   繁体   中英

SQL Server Indexes INSERT/UPDATE Performance

I know that indexes hurt insert/update performance, but I'm trying to troubleshoot and determine the right balance between query performance and insert/update performance.

We've created a number of views (about 20) for some really really complicated queries. They're really slow for seeking by keys (can take 20 seconds to scan for 5 to 10 keys).

Indexing these views (with both clustered and non-clustered indexes on the various key columns) speeds up their performance in the area of 80x to 100x. It also hurts insert/update performance to the point that a script which inserts about 100 rows into various related tables takes about 45 seconds to run instead of being instantaneous.

I'd prefer not to go the OLAP route for these views (it would add a whole new layer of complexity....and the views are currently updatable, which would pose a reverse synchronization problem)...so I'm trying to figure out how to balance query performance with insert/update performance.

Can someone please suggest how to diagnose the specific problem indexes - and potential ways of reducing their impact on inserts/updates?

I've already tried using covering indexes, indexes with INCLUDEs and composite clustered indexes as alternatives to see if it makes a difference (it doesn't really).

Thanks.

在这种情况下,请使用单列其他过滤索引,并避免包含两列以上的复合索引。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM