I have a situation of repeating identical database query, and identical related HTML on various places in application.
So what is the usual/best practice way of DRYing this?
Includes work perfectly for this situation, but if I adopt that as
method of DRYing, may I eventually end up with too many includes slowing down the app?
You could try having a central file for database queries and only including it where you need it. Similarly for html fragments.
You might find an MVC pattern useful in this instance (see http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller)