logo
episode-header-image
May 2022
17m 50s

Why this query is fast

Hussein Nasser
About this episode

Welcome to another database question. In this question I created a community poll question and provided some answers. All answers can be correct of course but the question is what is the most efficient? this is what I try to explore in this video and compare how different database platforms such as mysql or Postgres differ in those implementations;

Table T with three integer fields A, B and C.

A has a primary key clustered index.

B has a secondary index.

Which query is more likely to be the most efficient?

0:00 Intro

1:00 The Question

3:20 WHERE C BETWEEN 50,50000

5:30 WHERE B BETWEEN 50,50000

13:20 WHERE C BETWEEN 50,50000

Fundamentals of Networking for Effective Backends udemy course (link redirects to udemy with coupon)

https://network.husseinnasser.com

Fundamentals of Database Engineering udemy course (link redirects to udemy with coupon)

https://database.husseinnasser.com

Up next
Yesterday
CPU and Kernel Page Faults
<p>Page faults occurs when the process tries to access a memory that isn’t backed by a physical page kernel raises a fault which loads a page. It happens on first access, stack expansion, COW, swap and much more. However it comes with a cost. </p><p><br /></p><p>In this episode o ... Show More
48m 37s
Oct 31
Amazon US-EAST-1 Outage in Details
On October 19 2025 AWS experienced an outage that lasted over a day, 10 days later we finally got the root cause analysis and we know exactly what caused the DNS to fail0:00 Summary 5:30 How did Dynamo lost its DNS?13:41 EC2 Errors 16:16 Network Load Balancer ErrorsRCA here https ... Show More
24m 26s
Oct 17
Graceful shutdown in HTTP
There are cases where the backend may need to close the connection to prevent unexpected situations, prevent bad actors or simply just free up resources. Closing a connection gracefully allows clients and backends to clean up and finish any pending requests. In this episode of th ... Show More
25m 49s
Recommended Episodes
Mar 2020
Easier Stream Processing On Kafka With ksqlDB
<div class="wp-block-jetpack-markdown"><h2>Summary</h2> <p>Building applications on top of unbounded event streams is a complex endeavor, requiring careful integration of multiple disparate systems that were engineered in isolation. The ksqlDB project was created to address this ... Show More
43m 36s
May 2023
The ORMazing show
Nick & KBall sit down with the brilliant Stephen Haberman to discuss all things ORMs! 💻🔍 From the advantages and disadvantages of ORMs in general, to delving into the intricacies of his innovative project Joist, which brings a fresh, idiomatic, ActiveRecord-esque approach to Ty ... Show More
1h 12m
Oct 2023
166: Speedy Database Queries with Lukas Fittl
<p>- pganalyze: <a href="https://pganalyze.com/">https://pganalyze.com/</a></p><p>- Weekly series "5mins of Postgres": <a href="https://www.youtube.com/channel/UCDV_1Dz2Ixgl1nT_3DUZVFw">https://www.youtube.com/channel/UCDV_1Dz2Ixgl1nT_3DUZVFw</a></p><p>- How Postgres chooses whic ... Show More
1h 12m
Sep 2021
S17:E9 - What are some database architectures and their use cases (Kyle Bernhardy)
In this episode, we talk about database architectures and some of their use cases, with Kyle Bernhardy, CTO of HarperDB. Kyle talks about what a database is, different types of databases, and when you might want to use one type of database over another. Show Links DevDiscuss (spo ... Show More
48m 31s
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
Sep 2023
Episode 486: High Performance PostgreSQL for Rails with Andrew Atkinson
If you love taking about databases, this is the episode for you. Ahead of the launch of his new book, High Performance PostgreSQL for Rails, Andrew Atkinson joined the show with special guest co-host, Pat Bair, to talk about why he wrote a book, why he focused on PostgreSQL and h ... Show More
31m 29s
Feb 2024
Postgres Replication at speed with PeerDB's Sai Srirampur
<p>Join Scott Hanselman as he sits down with Sai Srirampur, as they explore the intricacies of Postgres Replication and how it can be turbocharged using PeerDB. In the realm of databases, Postgres Replication is like a well-choreographed dance between servers. Sai takes us behind ... Show More
27m 6s
Jun 2023
#420: Database Consistency & Isolation for Python Devs
See the full show notes for this episode on the website at <a href="https://talkpython.fm/420">talkpython.fm/420</a> 
56m 2s
Apr 2022
Postgres.js
Rasmus Porsager created Postgres.js –the fastest full-featured PostgreSQL client for Node.js and Deno. Today he joins Jerod for a deep-dive on Postgres, why he created this open source library, and how you can use it to build pg-backed JavaScript applications. Discuss on Changelo ... Show More
50m 6s