SQL Indexes - Definition, Examples, and Tips

  Рет қаралды 83,234

Database Star

Database Star

Күн бұрын

Пікірлер: 42
@DatabaseStar
@DatabaseStar 8 күн бұрын
Want to easily remember the SQL commands for your database? Get my free SQL Cheat Sheets here: www.databasestar.com/get-sql-cheat-sheets/?
@szilardfineascovasa6144
@szilardfineascovasa6144 Жыл бұрын
Love these easy-to-digest videos to cover missing pieces of knowledge or act as refreshers! Also, the teaching style. Thank you!
@DatabaseStar
@DatabaseStar Жыл бұрын
Glad you like the video!
@henriquelisboa3381
@henriquelisboa3381 10 ай бұрын
Thank you very much! I'm a newbie with databases but I need to work with one for a project and this video has the perfect balance between easy to understand and digging into advanced concepts! Wish you the best!
@DatabaseStar
@DatabaseStar 10 ай бұрын
Thanks, glad it was helpful!
@tomservo75
@tomservo75 Жыл бұрын
This is really nice, would you ever consider making a more advanced version, for people who know what indexes are but need advice on where to create them, what columns to add, single vs. multi-column
@DatabaseStar
@DatabaseStar Жыл бұрын
Great idea! I can create a video on that.
@ArchitecturalAesthetics2046
@ArchitecturalAesthetics2046 2 ай бұрын
love this video. So informative. functional based index was a new concept to me.
@DatabaseStar
@DatabaseStar 2 ай бұрын
Glad you liked it!
@rafaelbraga3d
@rafaelbraga3d 2 жыл бұрын
Thanks for the explanation. It was very very helpful. Now I really understand well indexes.
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Glad it was helpful!
@ItsWithinYou
@ItsWithinYou Жыл бұрын
Super! Many thanks for sharing!
@DatabaseStar
@DatabaseStar Жыл бұрын
No problem, glad it helped!
@WaliSayed
@WaliSayed Жыл бұрын
very useful, thank you!
@DatabaseStar
@DatabaseStar Жыл бұрын
You’re welcome!
@Felipe_Matheus_1991
@Felipe_Matheus_1991 5 ай бұрын
Thanks your video help me very much! Success to you my friend!
@DatabaseStar
@DatabaseStar 5 ай бұрын
Glad it was helpful!
@weekendprogrammer7545
@weekendprogrammer7545 Жыл бұрын
Thank you for this video, very helpful and explained so that any one can understand. I know it's a bit more to ask, but if it's possible to actually see the reduction in the time taken by actually running the queries in some database would be great.
@DatabaseStar
@DatabaseStar Жыл бұрын
You're welcome! That's a good idea, I do have some other videos on my channel that show the query before and after.
@weekendprogrammer7545
@weekendprogrammer7545 Жыл бұрын
I'll have a look at your videos list.. Thank you, really Appreciate the reply @@DatabaseStar
@arunajay8497
@arunajay8497 Жыл бұрын
great intro video, thank you
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks!
@siddharthapenchala8146
@siddharthapenchala8146 2 жыл бұрын
Thanks for the brief Explanation, Sir. Can you please clarify my doubt. Sir, I have created an index but the optimizer is not using it? What are Such cases where optimizer doesn't use the index?
@DatabaseStar
@DatabaseStar 2 жыл бұрын
It depends on the database, but generally it's because the database has found a better way. It could be the columns in the index do not match the query. It could be the distribution of the data means the index won't help/
@krs-tube
@krs-tube 11 ай бұрын
Thanks for the intro vid. You mentioned you're going to explain when to use clustered vs non-clustered index, but you didn't do it. Could you share your thoughts.
@DatabaseStar
@DatabaseStar 11 ай бұрын
Great point! I’ll create a video on this in the future
@nicholassmith6412
@nicholassmith6412 Жыл бұрын
another helpful video, thanks again
@DatabaseStar
@DatabaseStar Жыл бұрын
Happy to help!
@datalore6187
@datalore6187 Жыл бұрын
Does order matter when choosing which columns in the WHERE clause? Say for example I have a primary key index of (ID, LOCATION). There will be many ID's in the table, but only 5 LOCATION values. In my SELECT statement, should I use "SELECT * FROM EMPLOYEES WHERE ID = :P_ID_PARM AND LOCATION = :P_LOCATION_PARM" or should I use "SELECT * FROM EMPLOYEES WHERE LOCATION = :P_LOCATION_PARM AND ID = :P_ID_PARM"? Does it matter? Thanks!
@DatabaseStar
@DatabaseStar Жыл бұрын
Good question! No, I don't think the order of the WHERE clause matters (at least I haven't seen or read anything about this being considered by the database). The order of columns when creating an index with multiple columns definitely matters, but in your example I think both queries would be the same. You could check the execution plan for both queries and see what the differences are
@datalore6187
@datalore6187 Жыл бұрын
@@DatabaseStar Thank you! Interestingly enough, I ran a query both ways. It turns out that SELECTing on the column with the most values first speeds things up. So in my example, if I first SELECT on the ID column, and then SELECT on the LOCATION column, the results are faster than if I first SELECT on the LOCATION column, and then the ID column. Just wanted to share.
@8485Rockstar
@8485Rockstar 2 жыл бұрын
Great.......I have one question I don't know is it valid or not. Suppose I created one index on the primary key of one table, Will it run automatically, or need to create any job for that?
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Good question. Yes it will run automatically when needed, there's no need to create anything else to get it working.
@omega.developer
@omega.developer 2 жыл бұрын
very nice explaination
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Thanks!
@RoysIdea
@RoysIdea Жыл бұрын
B-tree seems very complicated. Or is this caused by the example image?
@DatabaseStar
@DatabaseStar Жыл бұрын
It could just be the example image. I include it to explain how it works, but for most of the time we don't really need to know how it works.
@Kleberei
@Kleberei 6 ай бұрын
@@DatabaseStar Because that example image does not visually represent a B-Tree. Every node, except for the root and the leaves, has at least ⌈m/2⌉ children and values do not repeat in a B-tree.
@apurvatripathi7633
@apurvatripathi7633 Жыл бұрын
TopNotch
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks!
SQL Indexes Explained in 20 Minutes
19:31
developedbyed
Рет қаралды 12 М.
7 Mistakes Beginners Make with SQL
10:47
Database Star
Рет қаралды 20 М.
How many people are in the changing room? #devil #lilith #funny #shorts
00:39
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 115 МЛН
How do SQL Indexes Work
12:12
kudvenkat
Рет қаралды 646 М.
Clustered vs. Nonclustered Index Structures in SQL Server
8:04
Voluntary DBA
Рет қаралды 664 М.
21. Database Indexing: How DBMS Indexing done to improve search query performance? Explained
1:23:52
SQL Index |¦| Indexes in SQL |¦| Database Index
9:57
Socratica
Рет қаралды 624 М.
I loaded 100,000,000 rows into MySQL (fast)
18:27
PlanetScale
Рет қаралды 180 М.
Triggers and Events in MySQL | Advanced MySQL Series
14:42
Alex The Analyst
Рет қаралды 64 М.
SQL Indexes | Clustered vs. Nonclustered Index | #SQL Course #21
43:10
Data with Baraa
Рет қаралды 2,9 М.
7 Database Design Mistakes to Avoid (With Solutions)
11:29
Database Star
Рет қаралды 89 М.
7 Database Paradigms
9:53
Fireship
Рет қаралды 1,6 МЛН
Telefonu Parçaladım!🤯
0:18
Safak Novruz
Рет қаралды 1,1 МЛН
Отключи новую кнопку на iPhone 16
0:39
Romancev768
Рет қаралды 470 М.
Самые УЖАСНЫЕ Dyson наушники! Dyson  #интересное
1:01
ТЕХНОБЛОГ АЛИША
Рет қаралды 455 М.
😱Кастомный Айфон 16 R🤯
0:39
Не шарю!
Рет қаралды 450 М.