At file:///home/tsk/mprog/src/5.3-mwl68/ ------------------------------------------------------------ revno: 2762 revision-id: timour@askmonty.org-20100219215557-g1uohrur8bopfv7n parent: psergey@askmonty.org-20100217215941-5uxponk64p55xg4a committer: timour@askmonty.org branch nick: 5.3-mwl68 timestamp: Fri 2010-02-19 23:55:57 +0200 message: MWL#68 Subquery optimization: Efficient NOT IN execution with NULLs This patch implements correct NULL semantics for materialized subquery execution. The implementation has the following properties and main limitations: - It passes all query result tests, but fails a number of EXPLAIN tests because of changed plans. - The EXPLAIN output for partial matching is not decided yet. - It works only when all necessary indexes fit into main memory. Notice that these are not the general B-tree/Hash indexes, but instead much more compact ones, therefore this limitation may not be a problem in many practical cases. - It doesn't contain specialized tests. - In several places the implementation uses methods that are modified copies of other similar methods. These cases need to be refactored to avoid code duplication. - Add a test if the predicate is top-level just before deciding on partial matching. If it is top-level, use a more efficient exec method (index lookup). - Add sorting of indexes according to their selectivity. The code is almost there. - Needs more comments, and to sync existing ones with the implementation. Diff too large for email (2568 lines, the limit is 1000).