Remove c
article thumbnail

Faster remainders when the divisor is a constant: beating compilers and libdivide

Daniel Lemire

I believe that all optimizing C/C++ compilers know how to pull this trick and it is generally beneficial irrespective of the processor’s architecture. In concrete terms, here is the C code to compute the remainder of the division by some fixed divisor d : uint32_t d =. ; // your divisor > 0. Can we do better?

C++ 279
article thumbnail

Deprecated features to take out of your toolbox – Part 3

SQL Performance

These types are on the deprecated list for many reasons, and have held a permanent spot on that list since being replaced by the max types way back in SQL Server 2005. name , [ Column ] = c. name , [ Data Type ] = TYPE_NAME ( c. system_type_id <> c. THEN N' (' + TYPE_NAME ( c.

C++ 58
Insiders

Sign Up for our Newsletter

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Trending Sources

article thumbnail

Fundamentals of table expressions, Part 5 – CTEs, logical considerations

SQL Performance

T-SQL supports it starting with SQL Server 2005. For example, you can use a query that is based on derived tables as the inner query of a CTE definition, as in the following example: WITH C AS. ( ) SELECT orderyear , numcusts FROM C ; However, the same does not hold true for a query that is based on CTEs. CROSS JOIN. (

C++ 140
article thumbnail

Web Performance Bookshelf

Rigor

Steve Souders, plus Dion Almaer, Doug Crockford, Ben Galbraith, Tony Gentilcore, Dylan Schiemann, Stoyan Stefanov, Nicole Sullivan, Nicholas C. You only have a few seconds to get compelling content onto the screen. Fail, and you can kiss your customers and profits goodbye.” ” – Andy King, 2003. Even Faster Websites.

article thumbnail

Overlooked T-SQL Gems

SQL Performance

Using a cursor, you would normally use code similar to the following: DECLARE @dbname AS sysname ; DECLARE C CURSOR FORWARD_ONLY STATIC READ_ONLY FOR. databases ; OPEN C ; FETCH NEXT FROM C INTO @dbname ; WHILE @@FETCH_STATUS = 0. databases ; OPEN @C ; FETCH NEXT FROM @C INTO @dbname ; WHILE @@FETCH_STATUS = 0.

C++ 111
article thumbnail

Additional T-SQL Improvements in SQL Server 2022

SQL Performance

75 Test XYZ Student C 55 Test XYZ 77.5 75 Test XYZ Student C 55 Test XYZ 77.5 If you’re using T-SQL to compute percentiles as part of your work, these functions should be familiar to you since they’ve been supported in SQL Server 2005 and later. 75 Test XYZ Student D 55 Test XYZ 77.5 75 Test XYZ Student H 65 Test XYZ 77.5

Servers 142
article thumbnail

Back-to-Basics Weekend Reading - A Decomposition Storage Model

All Things Distributed

The first practical modern implementation is probably C-Store by Stonebraker, et al. Combined with the rise of data warehouse workloads, where there is often significant redundancy in the values stored in columns, and database models based on column oriented storage took off.

Storage 87