Joints are heavy operations.įor normalized databases, duration is correlated to the join table size. Obviously, the denormalized version is much faster than the normalized one. In ordet to get the results, I ran each queries five times and I took the median value. (number of bars, number of wines, number of wines per bar). On queries below, numbers in parentheses represents : On each query, I changed some parameters. They are executed like described in the following schema.Įven if it can be strange according to the reading direction, it's perfectly valid on a technical side. That's the point! It's necessary to understand that relatinnal databases are treating queries. If we just read it, it can be strange to see that I'm using the json_each.value inside the SELECT whereas I will get this information into the FROM which is the next line. Let's talk about the query above, or more precisely about the sub-query. value AS idįROM bars_denormalized, json_each (bars_denormalized. After the join, we'll apply a filter based on our needs. With these two queries, we'll be able to see how to get data ob each table.įor the normalized version, we'll make a joint between the wines, bars_normalized and bars_wines tables.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |