Hi all, As per serg comments on the previous commit, I have modified the code to add an init function which will initialize all the cost factors at the start of the server. The latest code is at https://github.com/igniting/server/commits/selfTuningOptimizer. I have also attached the diff here. However, I am still not able to come up with an example for my test case for READ_TIME_FACTOR and SCAN_TIME_FACTOR. I will go through the code again to figure it out. Currently the test case which I have written just gives the workflow: EXPLAIN SELECT ...; Update constant tables directly; Reconnect; EXPLAIN SELECT. Once I have this figured out, I will move to measuring the query time, and updating the stats for the corresponding cost factors. I will also write a blog which will have more details. Regards Anshu Avinash On Wed, May 28, 2014 at 1:05 AM, Roberto Spadim <roberto@spadim.com.br> wrote:
nice :) maybe part of msql? :) very old times
nice, i will stay updated with this gson project, very interesting and a very good work :)
2014-05-27 15:35 GMT-03:00 Sergei Golubchik <serg@mariadb.org>:
Hi, Roberto!
On May 27, Roberto Spadim wrote:
Hi Sergei! nice :) i'm reading about it just one doubt i didn't understand everything yet there's a read time and a scan time, what the difference? read = sequencial read and scan = non sequencial read? or something like table read cost, index read cost?
Yes, the handler methods are:
virtual double handler::scan_time() { return stats.data_file_length / IO_SIZE + 2; } virtual double handler::read_time(uint index, uint ranges, ha_rows rows) { return ranges+rows; }
these are the default implementations, in the base handler class. Method names are historical and *very* old.
The return values are kind of "number of disk seeks". You can see that scan_time() assumes a sequential disk read of blocks of IO_SIZE bytes.
While read_time() assumes random reads of 'rows' rows from the data file and 'ranges' ranges from the index.
These default implementations, I suspect, predate even MyISAM.
Regards, Sergei
-- Roberto Spadim SPAEmpresarial Eng. Automação e Controle