Posts

SQL Server, managing concurrent updates with lock-free algorithms

Image
Hi guys!  Welcome to this first post of november. This time we will talk about one of my favourite topics: database theory . We will talk about managing concurrent updates in ARIES based database systems like our Microsoft SQL Server but also PostgreSQL or DB2 or others are. We have already talked about ARIES some posts ago here: Who’s who in the database world: C. Mohan (The ARIES Algorithm)   and I suggest to take a look at it. What will be discussed today is the work done by three researchers Hanuma Kodavalla , Raghavendra Thallam Kodandaramaih and Girish Mittur Venkataramanappa who works at Microsoft. Concepts and the arguments explained here are used also in SQL Server starting from the 2019 version. Enjoy the reading! Introduction As seen in the aforementioned post the ARIES protocol rely on the Write Ahead Logging (WAL) technique. This technique guarantee two of the four ACID properties: atomicity and durability. In particular the Durability property and so "no da...

Making SQL Server Database Backups Faster with the Intel® QuickAssist Technology (QAT)

Image
Hi guys, I know, we already talked about Intel QuickAssist Technology when we talked about the new features that the new SQL Server 2022 introduces . Briefly, using this technology  we are able to offload specific SQL Server workloads to hardware devices such as compressing a backup . Yes, additional hardware is needed, but even without it we can still use this techonology because in this case QAT driver will use your CPU todo the work. So this time is the right time for a benchmark! Intro Compressing a backup is a good idea because data inside a backup file (and even inside a database) is highly compressible, while overhead due to the compression time is usually acceptable. When you backup a database you can choose to compress data that will be written inside the backup file.  To do this just add the COMPRESSION option to the BACKUP T-SQL command: Starting from SQL server 16.x (SQL 2022) the syntax is slightly changed and you can choose the compression algorithm used. By de...

SQL Server, the new malware Maggie is infecting hundreds of SQL Servers

Image
Hi guys, We don’t usually talk about security, but I think it’s a good idea to keep your eyes open and stay informed. A new malware named Maggie has been found by the Security researchers Johann Aydinbas and Axel Wauer from the DCSO CyTec. Maggie has already infected over 250 Microsoft SQL servers worldwide although the most infected instances are found in South Korea, India, Vietnam, China, Russia, Thailand, Germany, and finally the United States. An analysis of this new backdoor revealed that it disguises as an Extended Stored Procedure DLL whoose name is SQLMaggieAntivirus_64.dll dated 2022–04–12. and digitally signed by DEEPSoft Co. Ltd, a company that appears to be based in South Korea. Maggie introduces a series of commands that an attacker can use to attack a SQL Server istance. For example Brute-forcing admin passwords can be executed through the commands “SqlScan” and “WinSockScan”.   That'all for today! Stay tuned and have a great week! Luca   Previous post : Databa...

Databases and surroundings: Wikidata, SPARQL & Scarlett Johansson

Image
Hi Guys, Welcome to this a bit off topic post. I must admit I am a huge fan of wikipedia. Wikipedia is free multilingual online encyclopedia born with the intent to collect all human knowledge. But not only is it free and multilingual, it is also collaborative.  Anyone can contribute according to certain criteria. If Wikipedia aims to collect all the human knowledge, there is also a parallel wiki that instead aims to catalog all this knowledge. We are talking about wikidata . Like Wikipedia, Wikidata is also a free and open knowledge base that can be read and edited by humans and machines.    In addition, Wikidata serves as a central repository for the structured data of Wikimedia projects, including Wikipedia but also Wikivoyage, Wiktionary, Wikisource and others.  Returning to practical, for example, every page of wikipedia is linked to an element of wikidata. Wikidata is therefore responsible for cataloging all this information through a series of properties and ...

SQL Server 2022 RC 1 is out! What's new?

Image
Hi Guys, After an almost exact month from the first release candidate (RC0) a new release candidate has been released. We talked about the innovations introduced by the RC0 here: SQL Server 2022 RC0, new features and capabilities. The great improvement of the TRIM function, Integrated acceleration and other features   Now it is time to take a look to this RC 1!       SQL Server 2022 Release Candidate 1 This new release candidate (RC) was announced on September 22, 2022 and has a version number 16.0.950.9 Microsoft also said that the Linux version will be out soon. This release candidate introduces a feature called Hybrid buffer pool with direct write as well as other improvements. But, what is the hybrid buffer pool feature? Hybrid Buffer Pool The Hybrid Buffer Pool feature was introduced in SQL Server 2019 (15.x) and now is further enhanced in SQL Server 2022 (16.x). This technology enables buffer pool objects to reference data pages in database files residing on...

Who’s who in the database world: C. Mohan (The ARIES Algorithm)

Image
Hi guys, Welcome to an atypical post! In this post I want to tell you a little bit about the history of the vast world of databases .  I will take this opportunity to talk about database theory . I know! ... it’s been a while! Today we talk about Dr. C. Mohan . But who is Dr. Mohan? Chandrasekaran Mohan is an Indian-born American computer scientist.   Does this name mean anything to you?  What if I told you that it was the person who conceived the ARIES family of algorithms?   But let’s start from the beginning..   Enjoy!   C.Mohan and the ARIES Algorithm Chandrasekaran Mohan is an Indian-born American computer born in Tamil Nadu (India) in 1955. After growing up there and finishing his undergraduate studies in Chennai, he moved to the United States in 1977 for graduate studies. He received his PhD in computer science from the University of Texas at Austin in 1981. After finishing his PhD in the database area in December 1981, Mohan joined IBM Research, the...

How to write performance queries! Take advantage of the Temporary Table Caching

Image
Hi Guys, I don’t usually talk about numbers but I have to say that almost 8000 clicks in just one month on my blog is really a huge amount! So, thanks to the 7000 k friends who follow me! In the last post (click here) we saw in detail how the tempDB database works. Today we see how to use what we learned to write in temporary tables as quickly as possible. In this way you can put your hand to your procedures to make them run ...and for free! Let’s see how to exploit the temporary table cache mechanism!  Enjoy! Temporary Table Caching In the previous post we saw that there are some rules to take advantage of the temporary table caching . We said that in the following cases table are not cached : Named constraints are not created DDL statements that affect the table are not run after the temporary table has been created.  for example the CREATE INDEX or CREATE STATISTICS statements Temp table is not created by using dynamic SQL Temp table is created inside another object,...