Press "Enter" to skip to content

Author: Kevin Feasel

Tokenization in SQL Server

Sebastiao Pereira demonstrates a combination of encryption and redirection to store sensitive data:

As privacy regulations tighten like General Data Protection Regulation (GDPR), Health Insurance Portability and Accountability Act (HIPAA), Payment Card Industry Data Security Standards (PCI DSS) organizations and more, there is an increased focus to protect sensitive information within databases. Tokenization is an option to adhere to those regulations. Let’s see how to implement SQL tokenization in SQL Server.

This is a reasonably clever solution, though if you need to search on any of the tokenized (i.e., encrypted and moved to a separate table) values, performance would be miserable. Even displaying the results for a moderately sized result set would run into serious performance issues. I suppose that if you, for some regulatory reason, need to keep these tokens stored elsewhere from the data, then you manage expectations the best you can.

Leave a Comment

Losing Data with PostgreSQL and Jepsen

Jeremy Schneider performs some tests:

This is a follow‑up to the last article: Run Jepsen against CloudNativePG to see sync replication prevent data loss. In that post, we set up a Jepsen lab to make data loss visible when synchronous replication was disabled — and to show that enabling synchronous replication prevents it under crash‑induced failovers.

Since then, I’ve been trying to make data loss happen more reliably in the “async” configuration so students can observe it on their own hardware and in the cloud. Along the way, I learned that losing data on purpose is trickier than I expected.

Click through to learn more. Jepsen has been the gold standard in testing distributed database systems for data loss.

Leave a Comment

Testing in R with testthat

Aida Gjoka writes a test:

Testing is an important step when developing code in R or any other language. If you are a Python user, you can consider reading our previous blogs in pytest. Writing tests helps us make sure that the code is working as expected. In the R ecosystem, the testthat package is one of the most used frameworks. In this blog we will explore some of the main properties of {testthat} highlighting some of the most useful functions with some examples.

Read on to see how it works. This isn’t a mocking library, but rather an assertions-based testing library. And near the end, Aida includes an extra library that helps with plot testing.

Leave a Comment

Memory Grant Feedback Woes

Rebecca Lewis explains an issue with memory grant feedback in SQL Server:

Before SQL Server runs a query, it estimates how much memory it needs for sorting and joining. But what if it gets it wrong?

  • Too little memory → Spills to tempdb (slow)
  • Too much memory → Starves other queries

SQL Server 2017+ tries to fix bad estimates based on previous calls with ‘Memory Grant Feedback’.  Kinda like:  ‘Last time I gave you 2GB but you only used 50MB. Next time I’m giving you less.’

This is great in theory, though Rebecca shows a case in which the end result might not be great.

Leave a Comment

Code Blocks and Inline Code in Markdown

Mike Robbins continues a series on Markdown:

Technical writers often need to embed code in their articles, whether snippets, configurations, commands, or examples. When presented clearly, code in your articles reinforces understanding and helps readers follow along more easily. When presented poorly, it creates confusion and frustration. This article demonstrates how to use inline code and code blocks effectively in Markdown, ensuring your code is readable, maintainable, and helpful to your audience.

This is, fortunately, a bit of Markdown that is very consistent across platforms.

Leave a Comment

SLRUs and MultiXacts in Postgres

Andrew Atkinson digs in:

The main purpose of SLRUs is to track metadata about Postgres transactions.

SLRUs are a general mechanism used by multiple types. Like a lot of things in Postgres, the SLRU system is extensible which means extensions can create new types.

The “least recently used” aspect might be recognizable from cache systems. LRU refers to how the oldest items are evicted from the cache when it’s full, and newer items take their place. This is because the cache has a fixed amount of space (measured in 8KB pages) and thus can only store a fixed amount of items.

Read on to learn more about these two concepts and how things have changed in Postgres 17.

Leave a Comment

Viewing Security Settings in OneLake Catalog

Aaron Merrill announces a new preview feature:

Introducing the Secure tab in the OneLake catalog—your central place to understand and manage access across Fabric items. From a single view, you can workspace roles with the View users experience and inspect or modify role OneLake security roles with View security roles. The Secure tab brings a streamlined view for governance teams and workspace owners to quickly validate permissions and tighten least‑privilege access.

Click through to see how it looks.

Leave a Comment

RETURNING Clause in PostgreSQL Update Operations

Hans-Jürgen Schönig wants the output:

PostgreSQL 18 offers a couple of new features such as asynchronous I/O (aio), improvements around indexing, and a lot more. However, there is one feature that has really caught my attention. While it might go unnoticed by many users, it is really powerful and, to me, somehow represents everything I like about PostgreSQL.

The improvement I want to focus on today is related to the way the “RETURNING-clause” works in PostgreSQL 18.

This behavior is very much like the OUTPUT clause in T-SQL. Though it appears that OLD and NEW are not themselves pseudotables like SQL Server’s INSERTED and DELETED, as there is an example that includes old and new columns together in the same row.

Leave a Comment