The Backend Engineering Show with Hussein Nasser

Can NULLs Improve your Database Queries Performance? - The Backend Engineering Show


Listen Later

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

        ...more
        View all episodesView all episodes
        Download on the App Store

        The Backend Engineering Show with Hussein NasserBy Hussein Nasser

        • 4.9
        • 4.9
        • 4.9
        • 4.9
        • 4.9

        4.9

        40 ratings


        More shows like The Backend Engineering Show with Hussein Nasser

        View all
        Software Engineering Radio by se-radio@computer.org

        Software Engineering Radio

        273 Listeners

        The Changelog: Software Development, Open Source by Changelog Media

        The Changelog: Software Development, Open Source

        292 Listeners

        Software Engineering Daily by Software Engineering Daily

        Software Engineering Daily

        625 Listeners

        The Cloudcast by Massive Studios

        The Cloudcast

        153 Listeners

        Talk Python To Me by Michael Kennedy

        Talk Python To Me

        585 Listeners

        Soft Skills Engineering by Jamison Dance and Dave Smith

        Soft Skills Engineering

        288 Listeners

        Python Bytes by Michael Kennedy and Brian Okken

        Python Bytes

        214 Listeners

        Y Combinator Startup Podcast by Y Combinator

        Y Combinator Startup Podcast

        236 Listeners

        Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

        Syntax - Tasty Web Development Treats

        983 Listeners

        Practical AI by Practical AI LLC

        Practical AI

        213 Listeners

        The Stack Overflow Podcast by The Stack Overflow Podcast

        The Stack Overflow Podcast

        63 Listeners

        The Real Python Podcast by Real Python

        The Real Python Podcast

        141 Listeners

        Dwarkesh Podcast by Dwarkesh Patel

        Dwarkesh Podcast

        505 Listeners

        Big Technology Podcast by Alex Kantrowitz

        Big Technology Podcast

        478 Listeners

        Oxide and Friends by Oxide Computer Company

        Oxide and Friends

        60 Listeners