Showing posts with label Itzik Ben-Gan. Show all posts
Showing posts with label Itzik Ben-Gan. Show all posts

Saturday, March 31, 2018

The Challenge Is on: Maintain a Custom Letter-Based Sequence

If you need to implement a custom sequence solution, and you want it to perform as well as possible, you need to ask yourself which guarantees the solution needs to provide versus which it doesn’t.
by Itzik Ben-Gan via IT Pro - Microsoft Windows Information, Solutions, Tools

Tuesday, February 20, 2018

The Challenge Is on: Multi-Way Number Partitioning with T-SQL and SQL CLR

The challenge is known as multi-way number partitioning. Given a set of numbers S, representing quantities or weights, and a number of desired partitions, k, divide the quantities into k partitions such that the quantities are as evenly distributed among the partitions as possible.
by Itzik Ben-Gan via IT Pro - Microsoft Windows Information, Solutions, Tools

Thursday, January 18, 2018

SQL Server: Avoiding a Sort with Descending Order

In this month's column I focus on queries that need to process data in descending order.
by Itzik Ben-Gan via IT Pro - Microsoft Windows Information, Solutions, Tools

Monday, December 18, 2017

SQL Server: Avoiding a Sort with Merge Join Concatenation

There are cases when SQL Server doesn’t normally realize it can rely on index order, but you can make the platform realize it with some extra manipulation and creativity. This article is the first in a two-part series in which I describe such tasks and solutions. This month I’ll talk about avoiding a sort with the Merge Join (Concatenation) operator. Next month I’ll describe avoiding a sort when needing the data in descending order.
by Itzik Ben-Gan via IT Pro - Microsoft Windows Information, Solutions, Tools

Monday, November 27, 2017

T-SQL Puzzle Challenge: Grouping Connected Items

The challenge involves an undirected cyclic graph that represents pairs of connected nodes that have some kind of a relationship between them. The goal is to group all nodes that are connected either directly or indirectly (transitively).
by Itzik Ben-Gan via IT Pro - Microsoft Windows Information, Solutions, Tools