|
There are various aspects of the embedded environment restrictions, such as the performance of embedded processors , limited memory, etc. , so the embedded real-time database management have very strict requirements , such as low memory footprint , efficient queries , etc., so also the embedded database products put forward higher requirements. Database is the most frequent operation , query query neutron occupies an important position and role , a great number of domestic and open source embedded database only provide simple subquery function or does not provide , implement and therefore has a very important sub-query optimization the significance of the main sub-query workload to achieve the following four points. First, the study of dreams virtual machine mechanism , careful analysis of each opcode operation code and meaning of the parameters , adding a self-designed some of the op-codes, and sub- queries related mainly to create a temporary table opcode OP_OpenTemp and through two indexes pointing record rowid bound to the clustered index opcode OP_Seek. Then, in the sub-query , the main achievement of the three seed query : 1.In subquery , including related In subqueries and irrelevant In subquery ; 2 . Comparison operator queries, constraints are the contents of the subquery single records, if more than one record , just take the first record ; 3.EXISTS subquery , EXISTS subquery that contains related and unrelated EXISTS subquery. And then in the sub- query optimization, the main achievement of the query flattening , through relational algebra equivalent transformation related algorithms, avoid the use of temporary tables. Finally , design experiments to achieve the three seed queries and query the flattening test , verify the results are correct, or to achieve the desired functionality.
|