logo
episode-header-image
Apr 2021
22m 41s

Can NULLs Improve your Database Queries ...

Hussein Nasser
About this episode

In this episode, we will discuss NULLs in database systems. I’ll go through the following:

What is Null?

NULLs persistence

  • Whether you store a 0 or 2 billion value in the field 32bit integer field it costs 32 bit
  • when you store a NULL in 32 bit integer field we save 32 bit but add overheads

When NULLs are naughty

  • Semantics and inconsistent result
  • Select count(*). Includes nulls
  • count(column) ignores nulls
  • T is NULL returns the null rows
  • T is NOT NULL returns not null rows
  • T In (NULL) returns nothing
  • T not in NULL returns nothing
  • Some database don’t index nulls

When NULLs are useful

  • I don’t have value , I don’t wish to provide a birthday
  • not applicable field for certain use cases but not others fat tables (denormlization)
  • Fat tables with many columns makes your rows longer which means fewer rows fit in your page (show pic).. NULLs help here .. that are NULL, it yields shorter rows, instead of storing a default 0 value



Support my work on PayPal

https://bit.ly/33ENps4

Become a Member on YouTube

https://www.youtube.com/channel/UC_ML5xP23TOWKUcc-oAE_Eg/join

🧑‍🏫 Courses I Teach

https://husseinnasser.com/courses

--- Support this podcast: https://anchor.fm/hnasr/support
Up next
Jun 13
kTLS - Kernel level TLS
Fundamentals of Operating Systems Course https://oscourse.winktls is brilliant.TLS encryption/decryption often happens in userland. While TCP lives in the kernel. With ktls, userland can hand the keys to the kernel and the kernel does crypto. When calling write, the kernel encryp ... Show More
22m 55s
May 9
The beauty of the CPU
If you are bored of contemporary topics of AI and need a breather, I invite you to join me to explore a mundane, fundamental and earthy topic.The CPU.A reading of my substack article https://hnasr.substack.com/p/the-beauty-of-the-cpu 
9m 38s
Apr 18
Sequential Scans in Postgres just got faster
This new PostgreSQL 17 feature is game changer. They know can combine IOs when performing sequential scan. Grab my database coursehttps://courses.husseinnasser.com 
27m 36s
Recommended Episodes
Jan 2024
Episode 159 - Select * Wastes Money
Guy and Eitan discuss various practices in SQL Server that hurt performance and possibly waste money, negative VarDecimal numbers, renumbering Identity columns, and the new Azure Database Fleet Manager. Relevant links: SQL Server IN Clause With Multiple Literal Values Performance ... Show More
37m 55s
Jun 2018
Training Resources for SQL Noobs
New to learning SQL Server? Get the scoop on free online resources to look up information, ask questions of community members, and learn SQL Server from the ground up. Links from the episode are at: https://sqlworkbooks.com/dear-sql-dba/training-resources-for-sql-noobs/ 
29m 10s
Feb 2024
Episode 507: Stephen Margheim on SQLite in Ruby on Rails Applications
If you start a new Rails project today, you’re probably going to pick Postgres for your database. And if you have a ten year old Rails app, you might be using MySQL. But Rails ships with support for SQLite, a lightweight SQL database. Can that lightweight database be used to make ... Show More
31m 21s
Feb 2024
Episode 160 - OPTION RECOMPILE and the magical Turbo button
Guy tries to convince Eitan that OPTION(RECOMPILE) is the ultimate "Turbo" button in SQL Server, and that it's strongly underappreciated. Relevant links for more info: OPTION(RECOMPILE) (Transact-SQL) - SQL Server | Microsoft Learn Recompile a Stored Procedure - SQL Server | Micr ... Show More
32m 49s
Oct 2022
Top 5 Data & Analytics Launches from Next 2022 with Bruno Aziza and Maire Newton
Debi Cabrera and Stephanie Wong have more great Next content this week as we focus on launches specifically related to data and analytics with guests Bruno Aziza and Maire Newton. We start the episode with a look at current customer trends in data, including tools for increasing ... Show More
30m 51s
Aug 2021
#467: [INTRODUCING] Amazon MemoryDB for Redis
Amazon MemoryDB for Redis is the newest fully managed database service from AWS. Today, Nikki is joined by Zach Gardner, Specialist Solutions Architect at AWS, to introduce this new Redis-compatible, durable, in-memory database service. Learn why we built MemoryDB and dive into b ... Show More
29m 36s
Oct 2023
Reducing The Barrier To Entry For Building Stream Processing Applications With Decodable
Summary Building streaming applications has gotten substantially easier over the past several years. Despite this, it is still operationally challenging to deploy and maintain your own stream processing infrastructure. Decodable was built with a mission of eliminating all of the ... Show More
1h 8m
Aug 2022
Tech job interview support group
Struggling through the tech job interview process? We feel you! On this episode, Amal, Nick & Amelia get together to discuss the various ways the interview process disappoints, share their own interview stories, and suggest ways we can improve the process for everyone. Discuss on ... Show More
1h 4m