@kodekloud: How Database Indexing Actually Works 🌳 Finding one user among 10 million takes about four reads with an index, against 10 million checks without one. The index is a sorted copy of one column, each value paired with its row number. A B-tree organizes it into blocks with signposts above them, so a lookup goes straight to the one block holding the name, then straight to the row. Your table stays untouched. Which column in your app would you index first? Tell us in the comments 👇 #DatabaseIndexing #BTree #SQL #Database #SQLPerformance #BackendDevelopment #DataStructures #CodingTips #SoftwareEngineering #KodeKloud
now explain what happens when the are 2+ of the same value in that column
2026-11-02 20:42:11
58
Shane H :
How does this work if the data in the table needs to be encrypted?
2026-11-03 13:36:35
3
Ollie :
Where Do primary key IDs fit in here? Or are they not really relevant for these sorts of operations?
2026-11-03 08:46:46
0
LordSnow :
how does it go directly to Nina in the last block ?
2026-11-03 20:30:16
0
J̌acksonion :
this works in SQL as well?
2026-11-14 10:55:35
1
Viktor Nikolovski :
I wanna know what happens when a new name enters the database, how do the indexes change and when
2026-11-04 12:48:17
1
mytxik90 :
let's just download the db and searching locally
2026-11-03 04:58:42
6
sedated verb :
B tree or not B tree
2026-11-03 01:50:20
1
akos12345asd :
Making large nodes is not always the best option, it may cause less nodes in the tree but you do more search in one mode. Also if no composite index is required in the query, you can use binary search in the nodes. If you do queries where you want to iterate starting froma. Specific point (pagination by searching the exact element) you can actually use a b+tree which have their leafs connected so going from one record to the next is always O(1) when reading. But makes the insertion deletion a bit more difficult to program, in general usage there is no visible drawback for using b+ tree
2026-11-02 22:05:51
1
abracadabra.xyz :
does indexing also speed up delete by column operation?
2026-11-03 02:02:49
0
Herr Perfekt :
how it works for something alphanumerics instead of pure strings?
2026-11-02 19:33:13
3
Angus Neilson378 :
but then the front end dev runs a sort first ..
2026-11-03 00:22:10
2
WscieklyWlaz75 :
BTW- you don't need table at all to find Nina - it is called fast index scan😂✌️🔥
2026-11-02 23:14:54
0
evnchy :
In some cases for some extreme large database with +100 million users and +100 thousand users search at the same time, we usually use the Big O Notation algorithms
2026-11-03 00:43:01
1
Jimmy the Fort :
Binary search 6 compares and you match
2026-11-03 02:16:34
1
akos12345asd :
Btw it isn’t a row index, but rather an internal id that the DB uses to reference a row in its binary represntation. If anyone wonders how it can get in almost O(1) to the correct location: it actually valculates the length of a row, then moves the cursor to that memory page and prefetches the next rows as well
2026-11-02 22:07:36
2
Mr Mos :
This is awesome, to think I just delivered a class on how Elastic indexing
2026-11-02 18:18:11
9
Pitch TV | IT explained :
Nina’s signposts only work if you know how the name starts. Search LIKE ‘%ina’ or LOWER(name) = ‘nina’ and the database usually can’t use that tree, so you’re back to scanning 10 million rows unless you add something like an expression index.
2026-11-05 06:23:37
2
Ridho Cahyani :
2026-11-18 03:37:24
0
skibïï :
Is this related to opensearch?
2026-11-15 18:49:38
0
. :
When do we stop doing daily index rebuild?
2026-11-14 23:46:15
0
Soprano T :
also worth noticing is that your dbms is smart enough and if you put index on column that contain small number of rows it will do seq filter instead of index
2026-11-11 12:10:07
0
Andrometa Defence 🛡️💻👾 :
Can you do SEQ Scan
2026-11-17 08:24:16
0
To see more videos from user @kodekloud, please go to the Tikwm
homepage.