Application query meta-information
I would like to pass along identifying information from the application layer for each query to allow full stack tracing. Normally today this is done (if at all) using comments in the SQL. But this has a number of disadvantages.
It would be nice if the driver libraries could pass along information such as request id, a stack trace identifier, client identifier, debugging parameters, and perhaps more as a json or other struct in a protocol level parameter when executing the query. This would allow prepared statements to be used effectively but still allow aggregating performance information by these parameters and also allow things like selectively logging requests. Just as an example on a large site you could allow requests coming from certain ip addresses ranges to set a url parameter which would enable verbose logging of the entire request from the application stack as well as the database and pick all the logs for that request out of the central logging system by searching for the request id or client identifier.