Sample Header Ad - 728x90

Is it normal to have 300 queries to display a single page?

-4 votes
1 answer
43 views
The total number of queries is: Q1 * Q2 * Q3, it might be 25 * 3 * 4 = 300, or maybe even more. all of these is for a single user displaying a single page! Should I duplicate the data and store them directly in the first queried table, this would reduce the number of queries dramatically from 300+ to a single query. Or should I leave the database normalized with no duplications? --- for example:
SELECT * FROM items
  JOIN descriptions on descriptions.id = items.description_id
  JOIN properties on properties.id = descriptions.property_id
  JOIN images on images.id = properties.image_id;
so I assumed the first table has 25 items, for each item there is 3 items and so on .. the number of joins should be a lot
Asked by Alsaraha (1 rep)
Nov 10, 2022, 04:21 AM
Last activity: Nov 10, 2022, 10:55 AM