>>>>> "Feng" == Feng Tian <ftian@stripped> writes:
Feng> On Tue, 6 Nov 2001, Sinisa Milivojevic wrote:
Feng> Thanks alot for the prompt answering. In case of lacking
Feng> an overall document,
Feng> 1. Is there anything describing the table type/handler?
Feng> I am particularly interested in this module because I may
Feng> need to write my own table format.
Take a look at the interface in
For an example of how to do this, take a look at
ha_berkeley.h and ha_berkeley.cc
Feng> 2. Is there anything describing the catalog and how optimizer
Feng> uses catalog?
When you create a table, MySQL creates a .frm file that contains the
field and key specifications. The table handler code is responsible
to create those files it needs.
To understand the table object, take a look at the structs/classes in
table.h and field.h
Feng> 3. I found I can force the join order by
Feng> using the "straight" option. Is there anyfor me to force
Feng> a join algorithm? For example,
Feng> select * from A, B where A.a = B.b
As we only have a 2 ways to do the join, there isn't any reason to
be able to force it ?
Feng> Can I force a sort-merge join instead of using nested loops?
No, because we don't yet have a sort-merge.
We have on the todo to do a hash-merge, but we haven't had time to do
Feng> If there is no such "force plan" mechanism, how hard if I
Feng> want to modify the optimizer to do this?
This should be rather simple.
The functions to change would probably be (in sql_select.cc):
and then do a function to handle the new join method that would be
The JOIN_TAB structure is defined in sql/sql_select.h