math

SQLServerCentral Article

Optimize Your SQL by Reformulating the Spec

  • Article

As SQL developers, we tend to think of performance tuning in terms of crafting the best table indices, avoiding scalar and table valued functions, and analyzing query plans (among other things). But sometimes going back to the spec and applying some properties of elementary math can be the best way to begin to improve performance of SQL queries which implement mathematical formulas. This article is a case study of how I used this technique to optimize my SQL implementation of the Inverse Simpson Index.

(3)

You rated this post out of 5. Change rating

2021-05-07 (first published: )

5,391 reads

Blogs

PowerPoint to HTML with Claude AI

By

I had an idea for an animated view of a sales tool, and started...

Don’t Miss Out – SQL Server Query Tuning Fundamentals Starts Next Monday!

By

Next Monday, February 9, 2026, my one-day live online training SQL Server Query Tuning...

Monday Monitor Tips: SQL Auditing Preview

By

One of the features we advocates have been advocating for is a better way...

Read the latest Blogs

Forums

SSRS shared dataset parameters not showing in expression builder

By SLL1966

I am creating shared datasets that our executive staff can use for creating reports...

SSRS shared dataset parameters not showing in expression builder

By SLL1966

I am creating shared datasets that our executive staff can use for creating reports...

Delta Lake: The Definitive Guide: Modern Data Lakehouse Architectures with Data Lakes

By Site Owners

Comments posted to this topic are about the item Delta Lake: The Definitive Guide:...

Visit the forum

Question of the Day

The Decoded Value

In SQL Server 2025, what is returned from this code:

DECLARE @message VARCHAR(50) = 'Hello SQL Server 2025!';
DECLARE @encoded VARCHAR(MAX);

SET @encoded = BASE64_ENCODE(CAST(@message AS VARBINARY(1000)));
SELECT BASE64_DECODE(@encoded) 

See possible answers