On a related note, does any one know of a parser + planner library that allows you to spit out a query plan (either logical or physical) in a serializable form (e.g. JSON)? For example, say I want to parse a query on the client side into a basic plan (that might be further optimised on the server side).