Huge number of SQL queries per page load

5 months ago

tutu10
Member | 1
+
0
-

So Phalcon is nice with its level of abstraction that “hides” sql queries to the level that we can forget we even use them. But when I actually checked how much queries one of my pages executes when loading paginated records (100 per page) the result was around 500… The queries were generated mostly due to simple relations (belongsTo / hasMany in model) because for every record i must fetch some details from another models. Is that many queries “normal”? Or should I find another way for loading my records, for example with multiple joins?

5 months ago

Tyraxor
Member | 29
+
+1
-

Hi, i think you posted to wrong forum, this one is for Nette Framework, not Phalcon.
But if you are interested, Nette have some nice DB optimalization for your use case.
Check this doc page: https://doc.nette.org/…ase-explorer