That's a good idea and has helped me find some uncached templates.
In debug mode, I see that all userfields are queried twice on a showthread page.
Once for the user who is browsing the page:
Code:
SELECT
userfield.*, usertextfield.*, user.*, UNIX_TIMESTAMP(passworddate) AS passworddate, user.languageid AS saved_languageid,
...
FROM vb_user AS user
LEFT JOIN vb_userfield AS userfield ON (user.userid = userfield.userid)
...
WHERE user.userid = 1
And as I suspected, they get queried for each individual post as well:
Code:
SELECT
post.*, post.username AS postusername, post.ipaddress AS ip, IF(post.visible = 2, 1, 0) AS isdeleted,
user.*, userfield.*, usertextfield.*,
...
FROM vb_post AS post
LEFT JOIN vb_user AS user ON(user.userid = post.userid)
...
WHERE post.postid IN (0,167,264360)
...
I am not planning on upgrading my forum anymore. So edit of the source code are not a problem for me.
So you would rather edit those queries instead of creating a new database table for the fields?