I'm currently exploring if a custom MySQL engine could fulfill my needs. I've been looking at http://forge.mysql.com/wiki/MySQL_Internals_Custom_Engine. One thing I wonder is: can I create an engine using an already existing (binary) file?
If yes, I guess(?) there is no "CREATE TABLE...
" so, how does MySQL know about this table?
EDITED Say I have a tool writing a big binary file called 'records.bin' which is a concatenation of the following C structure
struct Record
{
char field1[10];
int field2;
};
I want to write a custom MySQL engine to perform the following query:
((declare table t1 as 'records.bin' exists somewhere ???))
select field1 from t1 where field2=1;
It should be possible, as the documentation says:
The most basic storage engines implement read-only table scanning. Such engines might be used to support SQL queries of logs and other data files that are populated outside of MySQL.