So one of the things I finally started to figure out, at least
sorta, is the concept of VIEWS. I had known about them for some
time but never really understood why to use them. I had thought
they provided worse performance than by not using them and simply
using JOINs in a query. Well...the results I found were somewhat
surprising. When using a view to de-normalize a dataset used for
my Blog, I noticed an improvement of about 4-6 seconds on average
when running 80 threads with 10000 iterations than by using the
standard query. I ran these tests multiple times with the same
configuration and even tried different numbers of
threads/iterations. In all cases, using the view was faster. For
completeness, here is the original query and the updated one
using the view:
Using the view:
SELECT * FROM blogposts_view WHERE postid=$randomNumber;
Without the view:
SELECT BlogPosts.title, BlogCategories.name, …[Read more]