In MySQL, you can define a procedure in C++ that can access and
modify the data in a query before it is sent to the client. The modification
can be done on row by row or
GROUP BY level.
We have created an example procedure in MySQL 3.23 to show you what can be done.
analyse([max elements,[max memory]])
This procedure is defined in the `sql/sql_analyse.cc'. This examines the result from your query and returns an analysis of the results.
max elements(default 256) is the maximum number of distinct values
analysewill notice per column. This is used by
analyseto check if the optimal column type should be of type
max memory(default 8192) is the maximum memory
analyseshould allocate per column while trying to find all distinct values.
SELECT ... FROM ... WHERE ... PROCEDURE ANALYSE([max elements,[max memory]])
For the moment, the only documentation for this is the source. :(
You can find all information about procedures by examining the following files:
Go to the first, previous, next, last section, table of contents.