On Aug 15, 2006, at 12:26 , Peter Eisentraut wrote:

AgentM wrote:
I've always found it odd that database didn't determine which
statistics are the most interesting from the queries themselves.

The overhead of doing that on the fly is probably prohibitive.  More
explicit profiling support could be helpful, but that would seem a lot
more complicated than, say, a compiler profiling tool that merely has
to sort out the branch predictions.

Couldn't the session be explicitly transferred into a special analysis mode? Explain analyze could run on every query implicitly and point out time and row count discrepancies as HINTs. Multi-column joins, for example, could be pointed out and display whether or not there are related indexes.

Then, I imagine, I would regularly run all my app's prepared queries through this analysis mode to see what I could improve. Who knows the database better than itself?

-M

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

Reply via email to