#99505Useless SQL queries in extbase DataMapper
Description
Whenever Extbase resembles domain models from the database (DataMapper thawProperties), it also tries to load related models even if no relation is assigned.
Example:
Model Book, property “reservingUser”: stores UID of User record.
If no reservation is present, the field is “0” in the database.
Extbase still tries to:
@SELECT * from tx_…_user WHERE uid in (0)@
All these kinds of queries return an empty result of course.
Fixing this can save you 25% of your DB requests, depending on the involved models.