Problems displaying this newsletter? View online.
SQL Server Central
Featured Contents
Question of the Day
Ad for State of Database Landscape survey
The Voice of the DBA
 

Don't Let Corner Cases Drive Your Design

If you graph computer/query cost against the size of data, you can get four quadrants:

  1. small data, small compute (most CRUD app queries)
  2. small data, big compute (complex BI queries for this quarter, most reporting)
  3. big data, small compute (logs, audit data)
  4. big data, big compute (complex BI queries across all our data)

If you examine the costs here, 1 is the cheapest, with 2 and 3 having a similar cost. Number 4 is expensive, and it's why we often have big boxes running our database server software. However, where is most of our work? The majority is in quadrant 1, with 2 getting the second most action. 3 might rarely exist, as does 4, but we often design for 4. We have to as we don't want phone calls, ever. What we want is to provision a system large enough that we don't hear many complaints about performance. On premises, many of us have over-provisioned systems to handle the peak load to avoid phone calls.

Can we handle the peaks or the really important things that someone thinks are important? Everyone thinks their workload is important, and it is. To them. However, there are plenty of cases where someone could think about designing for specific types of workloads, rather than just aiming for quadrant 4. I've got an image of different types of workloads that I grabbed from the Small Data 2025 conference. For example, if I am working with things like Time Series data or streaming analytics, I might not need huge compute. I might be storing a lot of data, and I need space, but the compute is low. The analysis of that data, however, might be compute intensive.

This is a reason why we might separate analytic systems out as they often are in quadrants 2 and 4, and we might want serverless or scale up/down systems to handle the rare cases, and get a real cost for them. I found it particularly interesting that the Bronze tier might be where we have big data and big compute, but once we've moved to Silver or Gold, we might have lower compute and data requirements. This makes sense as Bronze is more staging, but it is a good reason why we might aim for a Gold layer in our organization and only keep that data for the long term; it's more cost-effective.

Often, for simplicity, we build a bigger system for all types of queries. In other words, we are letting corner cases drive our design. That might be required, but it might not be. In this area of cost concerns, especially in the cloud, designing systems with appropriate resource usage is something that might override the analyst's desire for queries across all data running as quickly as order lookups in an OLTP system. This might be even more true if we can predict some patterns in our workloads during system design. We can't scale up or down instantly, but in a lot of places, I wish I had been able to scale financial or reporting systems up for a few days as we close out the period and scale them down for the rest of the month.

When building a system, think about the practical nature of your requirements and assign a cost to them. Let users know what workload you're building a system to handle and set expectations on performance and cost. If you do that, you can let others decide when we handle corner cases and when we don't. That's often a much easier conversation when we have cost numbers to help customers understand the implications of their request.

Steve Jones - SSC Editor

Join the debate, and respond to today's editorial on the forums

Ad for State of Database Landscape survey
 
 Featured Contents
SQLServerCentral Article

Troubleshooting Common SQL Server Errors: 823, and 824

Nisarg Upadhyay from SQLServerCentral

Learn about the critical 823 and 824 errors in SQL Server and how to deal with them in this article.

External Article

Random Number Generator in SQL using Marsaglia Polar

Additional Articles from MSSQLTips.com

How can we build a random number generator using Marsaglia Polar method in SQL Server without the use of external tools?

Blog Post

From the SQL Server Central Blogs - Data Conferences – Worth Every Dollar

Kevin3NF from Dallas DBAs

Some of the best career enhancers you can buy.   Why I Go to Conferences I go for two big reasons: Learning from the best. The folks teaching at...

Blog Post

From the SQL Server Central Blogs - Monday Monitor Tips: ServiceNow Integration

Steve Jones - SSC Editor from The Voice of the DBA

Earlier this year I visited a customer that was using the Redgate Monitor webhook to integrate with ServiceNow. However, they were also trying to integrate in a richer way...

SQL Server Advanced Troubleshooting and Performance Tuning: Best Practices and Techniques

Site Owners from SQLServerCentral

This practical book provides a comprehensive overview of troubleshooting and performance tuning best practices for Microsoft SQL Server. Database engineers, including database developers and administrators, will learn how to identify performance issues, troubleshoot the system in a holistic fashion, and properly prioritize tuning efforts to attain the best system performance possible.

 

 Question of the Day

Today's question (by Steve Jones - SSC Editor):

 

A New Operator

In SQL Server 2025, what does this code return?
SELECT '1' || '0'
 

Think you know the answer? Click here, and find out if you are right.

 

 

 Yesterday's Question of the Day (by Steve Jones - SSC Editor)

Which Object Definitions Are Available?

For which of these object types can I get the code when I run the OBJECT_DEFINITION() function in SQL Server 2025? (choose 3)

Answer: Rule, Replication Filter Procedure, Default

Explanation: The list of objects for which this function works is:

  • C = Check constraint
  • D = Default (constraint or stand-alone)
  • P = SQL stored procedure
  • FN = SQL scalar function
  • R = Rule
  • RF = Replication filter procedure
  • TR = SQL trigger (schema-scoped DML trigger, or DDL trigger at either the database or server scope)
  • IF = SQL inline table-valued function
  • TF = SQL table-valued function
  • V = View

This doesn't work for indexes. Ref: OBJECT_DEFINTION() - https://learn.microsoft.com/en-us/sql/t-sql/functions/object-definition-transact-sql?view=sql-server-ver17

Discuss this question and answer on the forums

 

 

 

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.


Suggestions
Email change does not work - I changed my email address in Edit Profile page, but it has no effect - I still receive emails to my old mailbox. Did I miss anything? Thanks  
Editorials
Is Data Modeling Common? - Comments posted to this topic are about the item Is Data Modeling Common?
Personal Contact Is Vital - Comments posted to this topic are about the item Personal Contact Is Vital
An Unexciting Exciting Release - Comments posted to this topic are about the item An Unexciting Exciting Release
The case for "Understanding our business" training - Comments posted to this topic are about the item The case for "Understanding our business" training
Don't Create Workslop - Comments posted to this topic are about the item Don't Create Workslop
Article Discussions by Author
SQL Server 2025 Build List - Comments posted to this topic are about the item SQL Server 2025 Build List
Filtered Indexes: The Developer’s Secret Weapon in SQL Server - Comments posted to this topic are about the item Filtered Indexes: The Developer’s Secret Weapon in SQL Server
Getting The Database Name - Comments posted to this topic are about the item Getting The Database Name
Getting the Schema for Tables - Comments posted to this topic are about the item Getting the Schema for Tables
UNLOGGED Tables in PostgreSQL: When Speed Matters More Than Durability - Comments posted to this topic are about the item UNLOGGED Tables in PostgreSQL: When Speed Matters More Than Durability
Specifying the Collation - Comments posted to this topic are about the item Specifying the Collation
SQL Server 2025 has arrived! - Comments posted to this topic are about the item SQL Server 2025 has arrived!
SQL Server 2022 - Development
SQL Server 2022 order by bug? - Hi, I was using order by on a column with characters and saw something I couldn't explain. Seems a bug to me, or am I missing something. SELECT @@VERSION SELECT N'1.' Id UNION ALL SELECT N'1-' Id ORDER BY Id SELECT N'1.w' Id UNION ALL SELECT N'1-w' Id ORDER BY Id DECLARE @s TABLE (Id […]
Looking for help with SQL statement - Hi there I am seeking some help with an SQL statement. Any help would be welcomed. TIA   See the query i have used below. I have an SQL statement that is trying to return all the values of a column from a table called stockallocations. However as no record exists for one of the […]
 

 

RSS FeedTwitter

This email has been sent to {email}. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com. This newsletter was sent to you because you signed up at SQLServerCentral.com.
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
webmaster@sqlservercentral.com

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -