This question is an extension of a previously asked question Index Strategy and Query optimization, which further extends this question: Search between IP string addresses

I implemented the two new indexes that Ypercube recommended. While the query for the InsideIp lookup completed much faster (1.5 minutes versus 9 minutes), the OutsideIp lookup is still running after 1.5 hours. I will let the query run over the weekend to see if it even completes. Note: the InsideIp list contains 3 DISTINCT IPs while the OutsideIp list contains approximately 60K DISTINCT IPs.

I understand the server may be constrained memory-wise and probably needs more memory and potententially a combination of more CPUs and disk(s) (for multiple database files that allow for LUN/stream optimization).

Before I travel down that path, I am thinking three alternative approaches.

  1. Change the clustered index as previously mentioned (ProtocolKey, NetworkStartIpHex, NetworkEndIpHex, RowKey)
  2. Place the lookup columns (ProtocolKey, NetworkStartIpHex, NetworkEndIpHex, RowKey) in an in-memory (OLTP) table.
  3. Partition the table. But, not sure how to effectively partition over a VARBINARY(16) column. I know VARBINARY(MAX) is explicitly ruled out by Microsoft, but is VARBINARY(16) ruled out as well?

Can anyone provide some insights as to which might be better?

  • Have you tried a clustered column store index at all? Mar 9 '19 at 0:00
  • @Mr.Brownstone Initially I did not even consider it due to limitations that exclude INCLUDE and ALTER statements. Would you say column store index is better? If yes, can you provide some insights?
    – J Weezy
    Mar 9 '19 at 5:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.