This has always been a company channel so you will see a variety of people here! Aaron has his own channel if you'd like to follow. Search Aaron Francis.
@MrDaskaF
5 ай бұрын
Yeah, sorry, I was being facetious@@HollyGuevaraPS
@pavankumargumparthy4546
5 ай бұрын
Hey @planetscale Firstly, thank you so much for this series, it's really helpful. Thanks again. One query on this though: Starting with the first recommendation we altered the pk of the table from mediumint to bigint immediately after that I observed a change in table size dropping from 2.1GB to 1.9GB (timestamp: 6:08) could you please help me understand why it is soo? Doesn't bigint take more space than int/ mediumint? Please...
@PlanetScale
5 ай бұрын
Excellent question. When the change is made to the schema, the underlying table gets rebuilt. When this happens, it's possible MySQL was able to make some optimizations that actually ended up making the table smaller! More info on table optimization here: dev.mysql.com/doc/refman/8.0/en/optimize-table.html
@edhahaz
5 ай бұрын
Well the content is still good, can't give you hate for it, but you know...
@ahmad-murery
5 ай бұрын
Thanks Ben, that was helpful. anyways, I always add indexes to columns that are foreign-keys or used in WHERE, ORDER BY or GROUP clauses, after doing that I look for other methods to optimize my query.
@PlanetScale
5 ай бұрын
Good technique 💪! You may not need an index an ALL of those columns (to avoid index bloat) but of course you can use EXPLAIN ANALYZE to get some good insights into what does and doesn't need an index.
@ahmad-murery
5 ай бұрын
@@PlanetScale I don't know but, most of the time these columns contain keywords to filter by just like the room example you used in your video. It would be interesting to find out where indexes are not necessary in my case.
@PlanetScale
5 ай бұрын
@@ahmad-murery Right! However, it could be the case that some of the indexes are less valuable than others. For example, if you have a WHERE could with an additional ANDed clause, you might have an index on both of the columns being filtered by, but it could be the case that the majority of rows are filtered out with the first one, and so an index on the second one is "wasted". All depends though on your queries, tables, etc!
@ahmad-murery
5 ай бұрын
@@PlanetScale Sure, I'm aware of combined indexes, I use them when they fit especially that I know the order of the columns in combined index does matter. I really appreciate this great conversation.
@PlanetScale
5 ай бұрын
@@ahmad-murery If you like these kinds of conversations, you'll love our discord server. Link in description.
Пікірлер: 12