Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ByteByteGo Daily] Database Indexing Strategy #146

Open
reboottime opened this issue Jul 6, 2023 · 5 comments
Open

[ByteByteGo Daily] Database Indexing Strategy #146

reboottime opened this issue Jul 6, 2023 · 5 comments

Comments

@reboottime
Copy link
Owner

reboottime commented Jul 6, 2023

Overview

This a note of reading the Database Indexing Strategies by Alex Xu, which provides an in-depth look at index architecture and discusses best practices to design effective indexes to meet the needs of our application.

Why indexing strategy matters:

  • Effect of poorly designed indexes and lack of indexes: are primary sources of database applications bottlenecks
  • As database grows in size, finding efficient ways to retrieve and manipulate data becomes increasingly important.
@reboottime
Copy link
Owner Author

Basic Of Indexing

An index in database is much like the index of a book, is a data structure that speeds up data retrieval operations.

The structure of a database index includes an ordered list of values, which each value connected to points leading to data pages where these values reside.

  • The structure of database index includes an ordered list of values, with each value connected to pointers leading to data pages where these values reside.
  • Indexes are typically stored on disk. Keys are made from one or more columns in the table make up the index, which most relational databases. are stored in a B+ tree structure
  • Finding the right indexes for a database is a balancing act between quick query responses and updates costs
    • Narrow Indexes, save on disk space and maintenance
    • wide indexes cater to a broader range of queries.
    • Often, it requires several iterations of designs to find the most efficient index.

@reboottime
Copy link
Owner Author

Primer on B+ Tree

@reboottime
Copy link
Owner Author

Clustered Index

@reboottime
Copy link
Owner Author

Non-clustered Index

@reboottime
Copy link
Owner Author

Understanding Index Types

Primary Index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant