What are Optimizer Statistics? Databases for Developers: Performance #2

  Рет қаралды 18,719

The Magic of SQL

The Magic of SQL

Күн бұрын

Пікірлер: 21
@abruenin236
@abruenin236 Жыл бұрын
Your way to explain with bricks, toys, cards and whatever makes understanding complicated things so much easier. These are hands down the best trainings videos I know, many thanks.
@TheMagicofSQL
@TheMagicofSQL Жыл бұрын
Thanks, glad you find these useful!
@furtivesock
@furtivesock 3 жыл бұрын
Love the fact that your videos have all subtitles! It is so rare and helps a lot, really.
@mohamed.macaloumo9763
@mohamed.macaloumo9763 4 жыл бұрын
The best explanation on the optimizer I have ever seen! Can't wait to see more! Thanks again Chris to share your knowledge.
@TheMagicofSQL
@TheMagicofSQL 4 жыл бұрын
Thanks! Stay tuned, there's more coming :)
@chennakesavalu5392
@chennakesavalu5392 4 жыл бұрын
Hi Chris Saxon sir, Your explaining about performance tuning tips good especially explain plan, statistics, cardinality and selectivity. Can you please do the more videos on sql and plsql performance tuning. Thank you very much sir sharing your knowledge...
@TheMagicofSQL
@TheMagicofSQL 4 жыл бұрын
Thanks, there are several more videos in this series coming soon. Stay tuned...
@mostafayahia9647
@mostafayahia9647 4 жыл бұрын
First of all i think you deserve more than just a like thank you
@dheerajvarthi4657
@dheerajvarthi4657 6 ай бұрын
Thanks a lot 🙏
@mexicanmomo
@mexicanmomo Жыл бұрын
Hi Chris, If I understand correctly oracle or any other DB does these back ground jobs to create these statistic. Since these are data driven jobs, anything can go wrong and that leads to performance issue in queries especially you have large tables, multiple joins etc . How does Oracle deal with this ? or it is left to the one who writes the query ? Even if I tune the query, when records increase or variety of data increases, query can under perform. what is the solution then ?
@TheMagicofSQL
@TheMagicofSQL Жыл бұрын
If something "goes wrong" with the stats gathering job, this is something you should take up with support. That said, even "perfect" stats have limitations which can lead to incorrect row estimates => slow plans. The reasons for this and what to do about this a large topic that's too big to cover in a comment! Some of the other videos in this performance series & the channel generally discuss various details.
@norm1124
@norm1124 2 жыл бұрын
Great Video, thank you
@nada4945
@nada4945 3 жыл бұрын
Great video! How can I set my preferences to gather extended statistics for all tables and thus avoid skews?
@TheMagicofSQL
@TheMagicofSQL 3 жыл бұрын
Skew is in the data itself - extended stats just helps the optimizer spot this in some cases If you want to get into the details of this, check the docs: docs.oracle.com/en/database/oracle/oracle-database/19/tgsql/managing-extended-statistics.html#GUID-BD0F0B71-DD8B-44A0-888E-495830FC09A4
@SunilKumarNoothi
@SunilKumarNoothi 3 жыл бұрын
Hi Chris, two question when we added yellow color - we have four colors and mentioned that 4 colors can't be fit into 3 buckets. a) how come 3 buckets are arrived ? b) when distinct colors increased to 4 in our case (3 to 4) why did # of buckets didn't increased? BTW - feeling great by involving in this Databases for Developers: Performance course.
@TheMagicofSQL
@TheMagicofSQL 3 жыл бұрын
It's just for example. By default in Oracle Database you get 254 buckets; the database will keep creating new buckets up to this number. You can override this with your own upper limit (up to 2,048).
@SunilKumarNoothi
@SunilKumarNoothi 3 жыл бұрын
@@TheMagicofSQL ok Thanks Chris. so technically we can't have more than 2048 buckets. Got it 👍
@TheMagicofSQL
@TheMagicofSQL 3 жыл бұрын
Correct, though in most cases it's best to stick with the default of 254
@vishvendradeepak1419
@vishvendradeepak1419 3 жыл бұрын
@@TheMagicofSQL Hi Chris, if the no. of distinct values is around 1200 then I think we should increase the bucket size. As this will give more accurate estimates.
@NewYork0110J
@NewYork0110J 3 жыл бұрын
Does table statistics stores min and max values of the column. So when you ask max value of the column of the table. Does query checks into statistics value or do have full table scan again to get the value.
@TheMagicofSQL
@TheMagicofSQL 3 жыл бұрын
Yes, the stats record the min/max values for each column. Remember these figures are a snapshot though, so will often be out-of-date. So using these to answer min/max (col) queries will give incorrect results in general! If there's an index on the target column, the database can to a min/max value search of the index - this is very fast.
🕊️Valera🕊️
00:34
DO$HIK
Рет қаралды 5 МЛН
Watermelon magic box! #shorts by Leisi Crazy
00:20
Leisi Crazy
Рет қаралды 114 МЛН
The Rise of Oracle, SQL and the Relational Database
22:19
Asianometry
Рет қаралды 154 М.
Oracle Performance Tuning - Read and interpret Explain Plan
17:43
Database Indexing for Dumb Developers
15:59
Laith Academy
Рет қаралды 64 М.
Real-Life SQL Tuning: From Four Minutes to Eight Seconds in an Hour
41:20
Oracle Developers
Рет қаралды 36 М.
How to Read an Execution Plan: Databases for Developers: Performance #1
9:34
Learn Database Normalization - 1NF, 2NF, 3NF, 4NF, 5NF
28:34
Decomplexify
Рет қаралды 2 МЛН
7 Database Design Mistakes to Avoid (With Solutions)
11:29
Database Star
Рет қаралды 80 М.
Using DBMS_XPLAN.DISPLAY_CURSOR to examine execution plans
12:33
Maria Colgan (SQLMaria)
Рет қаралды 35 М.