This week I planned to work on the InnoDB relations support feature for db_qbe search. Though I couldn’t come up with some committed progress towards the feature’s implementation, but I studied closely how LEFT JOIN creation currently happens in case of PMA’s internally defined relations. And I tried to make myself understand what exactly needs to be done to integrate InnoDB relations.
Currently, LEFT JOIN generation procedure involves following order in libraries/DBQbe.lib.php:-
=> _getIndexes() // provides us which tables have UNIQUE and INDEX columns and which are with/without valid where clauses
=> _getLeftJoinColumnCandidates() // provides us with best possible table.columns based on UNIQUE, INDEX, with/without valid where clause info
=> _getMasterTable() // provides master table for LEFT JOIN from table.column candidates (smallest based on records count)
=> _getFromClause() // sets from_clause = master_table + PMA_getRelatives(all_tables, master_table)
=> PMA_getRelatives() // looks for master->foreign and foreign->master entries in PMA internal relations table and generates LEFT JOIN clause.
So, only PMA_getRelatives finally looks for PMA’s internal relations and before that we just try to find out the best master table. So while thinking about introducing InnoDB relations into this flow, I still need to ascertain whether the same master table is to be used in case of InnoDB relations too and also I need to decide how to use PMA_getForeigners() (that provides us InnoDB foreign relation details for a table) in PMA_getRelatives().
And as it was taking too much time for now, I have currently moved on to PMA’s ‘highcharts‘ to ‘jqplot‘ migration and I’ll get back to InnoDB feature later.
Recent Comments