Mysql Index Tutorial | Make websites 100 Times Faster!!! Query time from 2 Sec to 3 Milli Seconds

Sdílet
Vložit
  • čas přidán 17. 10. 2020
  • Here I'll show how we can speed up our Mysql Queries using MySQL indexes. We'll convert queries that take over 2 Seconds to under 3 Milli Seconds.
    Create Index: dev.mysql.com/doc/refman/5.7/...
    Drop Index: dev.mysql.com/doc/refman/5.7/...
    Create table: dev.mysql.com/doc/refman/5.7/...
    Alter Table: dev.mysql.com/doc/refman/5.7/...
    Mysql Indexes allow us tell Mysql databases to index specific columns. This works similar to how regular indexes work in books. Similarly, when DB tables are indexed, Mysql searches in the index column to return the data. This is faster since it does not crawl through each row, but instead uses binary search to get the results. Mysql by default uses B-Tree index on all indexed columns.
    In this Mysql Index Tutorial, we will create index on a table with close to 3 million records. We will use index on single column and on multiple columns and see the time differences. Here we will also how Mysql Indexes work and how Binary search concept is used in the Mysql Index.
    SUBSCRIBE: / @technotrax
  • Věda a technologie

Komentáře • 41

  • @jamesdube7597
    @jamesdube7597 Před 2 lety +3

    Thanks, brought my query from 40 seconds to 200 ms on a table with 12 million entries

  • @alex-sd
    @alex-sd Před 2 lety +2

    Excellent explanation on this topic. Thanks so much!

  • @NikGamer1793
    @NikGamer1793 Před 2 lety

    Thanks mate, was avoiding to learn this as couldn't find such simple example. 😁✌

  • @bekaarcontent6482
    @bekaarcontent6482 Před 3 lety

    Perfect Explaining Thanks Dude !

  • @banganirikifidele2432
    @banganirikifidele2432 Před 2 lety

    Exactly, This is the solution of what I was looking for

  • @mariemmatri8743
    @mariemmatri8743 Před 3 lety +1

    Great video, Thanks a lot !!

  • @georgetsamis6318
    @georgetsamis6318 Před 3 lety

    Really great and simple video

  • @amosherron
    @amosherron Před 2 lety +6

    This video helped me take a query from 25 seconds to 0 seconds! Thank you!

    • @webdbase
      @webdbase Před rokem

      The query has been cached...

    • @heyjitendra
      @heyjitendra Před 11 měsíci

      How to do cache query? Using redis??

  • @nizomiddinzaripov4655
    @nizomiddinzaripov4655 Před 2 lety

    very useful video, thank you!

  • @artemisaix
    @artemisaix Před 2 lety +2

    What are the guidlines for desinging index on a table.? I mean for example, how many columns can I index, what are the best kind of columns to add an index, what are the NEVER DO on index g design? If someone have info about that I'll appreciate

  • @emekatimothyiloba699
    @emekatimothyiloba699 Před rokem +1

    Nice Explanation

  • @nareshbisht7620
    @nareshbisht7620 Před 2 lety

    Bro this is a quality video thanks you. you should make more video.

  • @chintanpatel2229
    @chintanpatel2229 Před 2 lety

    Life saver video.

  • @hirinux413
    @hirinux413 Před 2 lety

    Good explanation!

  • @bhumit070
    @bhumit070 Před rokem

    Will this still work if we use LIKE operator for querying data

  • @thangws7064
    @thangws7064 Před 3 lety +1

    Your video is so great. Can you post the .sql file on because i want to practice this. Thanks so much ❤️

  • @singarimahalaxmi6835
    @singarimahalaxmi6835 Před 3 lety

    FOR EX. MY TABLE SIZE IS 300GB THEN INDEXES ARE WORKING FING OR ANY ALTERNATE WAY IS THERE IN MYSQL? PLZ SUGGEST ME

  • @ashutoshdwivedi3976
    @ashutoshdwivedi3976 Před 2 lety +4

    Can you please share the .sql file for practice? Thanks in advance

  • @papsirhty5812
    @papsirhty5812 Před 2 lety

    Hi sir sorry hope you can help me i want to apply this tutorial on my simple website to speed up the result everytime i hit search button. Ive already add index. I mean its working using mysql but not working in my website ? But when i drop the table the button is working again. Thank u God bless

  • @maksat607
    @maksat607 Před 2 lety

    How about indexing date column?

  • @shericeross3241
    @shericeross3241 Před 2 lety

    PERFECT!!

  • @Rahulverma-zt3sx
    @Rahulverma-zt3sx Před 2 lety

    Thank you so much

  • @KerbadouGhazali
    @KerbadouGhazali Před rokem +1

    Thanks a lot for this tutorial, you helped me a lot.

  • @falentinodjoka6732
    @falentinodjoka6732 Před rokem

    I've tried your tutorial, but it does not give me an effect. I don't know why, but maybe cause my table only contain 2035 rows data, so i can't feel the effect of index. Can I get that table please? I wanna try it on my localhost.

  • @luciano_mdc7443
    @luciano_mdc7443 Před měsícem

    Which is your editor or client?

  • @pctechcomputers513
    @pctechcomputers513 Před 9 měsíci

    hi. we are getting an FATAL error when we update any data. Can you please help.

  • @ahmedhelal174
    @ahmedhelal174 Před 2 lety

    Thank you

  • @theyoogle
    @theyoogle Před 11 měsíci

    Its good, please make a tutorial on mysql cpu/ram configuration

  • @ranvijaymehta
    @ranvijaymehta Před rokem +1

    Wow now i became expert also

  • @anurajms
    @anurajms Před rokem

    thank you

  • @pradnyakasar614
    @pradnyakasar614 Před rokem

    I got this error (Error Code: 1071. Specified key was too long; max key length is 3072 bytes)

  • @codemelife
    @codemelife Před 2 lety

    ❤❤

  • @johnsailor3590
    @johnsailor3590 Před rokem

    Those queries are running with MySQL cache…. Those aren’t the correct results.

  • @Laravelcode
    @Laravelcode Před 11 měsíci

    this is not valid way to index to any varchar

  • @tioadjie5361
    @tioadjie5361 Před 2 lety

    Thank you query faster

  • @MdRakib-rc6ub
    @MdRakib-rc6ub Před rokem

    I need a simple script. Search query from 100 million rows faster way? Budget $50

  • @KornYellow
    @KornYellow Před 2 lety

    หัวจัย