Wow - so much discussion!
Postgres version - in this case I'm using 7.4.2, but I have also used prepare in 7.3.4 (not sure exactly what version it appeared in - either 7.2 or 7.3 something)
I first thought of preparing all queries on startup, but discarded that for the obvious reasons. I was imagining a tag in the xql query section for the developer to judiciously indicate "pre-prepare this query". The preparation could be done on first use rather than startup so we don't impact the (already long) startup time.
I didn't consider how to deal with the fact that the prepare statement needs to know the data types. Since I am planning for the developer to have to flag that they want the query prepared, i can also extend the queryset group to have a way to specify the types for a particular query.
Also since it is developer instigated per query, there won't be any problem with non-complete query fragments (like listbuilder queries with filters - just won't be able to prepare them unless we radically change the way filters work. Shouldn't be too hard to make sort by queries prepareable I imagine).