-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Adds RTree group in doxygen * Adds structures and function for RTree in meos There are two important structures. RTreeNode and RTree. There are 4 basic functions to interact with this structures: create and rtree, insert something to it, query and rtree and free the memory of an rtree. * Adds RTree in memory index We include a basic structure for the Rtree which is working for STBoxes. It allows to insert one by one. Queries are done with an STBox. A function to find each value as a double is required to be passed down to the RTree itself. * Fix lint to C files * Adds Example of RTree Since there is no tests for C code and only for sql code, this example is in some way also a test. It shows how you would normally use the Rtree, inserting and querying. * Fix imports in rtree * Fix small error on import * Fixes small bug The largest axis was always choosing to split via the first element. Now it changes. Some thought should be done for the temporal axis since it is normally in a different scale. Maybe a mahalanobis distance would be better. * Moves definition of rtree node away from meos meos.h should only have information that the user would use. RTreeNode is no an structure that a user would use. Thus, is better to have it in tpoint_rtree.h and have a forward definition in meos.h for RTree node. * Changes malloc and realloc for palloc and repalloc Keeping it consistent with the rest of the codebase * Reduces the malloc calls in Rtree RtreeNode will allocate only once and there will be no need to allocate when inserting since it copying to an already allocated block of memory. * Creation of RTree done with meostype I have assumed meostype as an int since I meostype is defined in meos_catalog and I can't import it from meos.h, thus int was best option I had. * Refactor BRANCH and LEAF into RTREE_INNER_NODE It was ambiguous that both #defines were related so they were refactored as RTREE_INNER_NODE and RTREE_INNER_NODE_NO * Improvements to documentation Adds missing documentation to newly add functions * Improves readability in vector-ish implementation To answer the query of rtree_search it is necessary to realloc memory, thus the code can become a little obscure. Added one extra function and some comments to make life easier for maintenance. * Fix lint * Adds timing in tests Included some time taking sinceit is important to know the difference between bruteforce and RTree search. * Adds endline * Deletes some comments * Node box calculate does not use the heap Change it so that when finding the minimum enclosing STBox there is no need to allocate new memory. * Unioned area doesnt use palloc Use a simple STBox instead of a palloc. * deletes unnecesary import * Adds Metadata for Rtree to include basetype This method obscures the use of basetype and other information to the final user, he calls rtree_create_stbox() and inside of it is called rtree_create(T_STBOX) which makes the process cleaner for meos. * Fix lint * Deletes the count and stbox from the RTree struct The count is being deprecated and the box is being inserted into the metadata. * Avoid using intermediate RTreeMetadata struct * Remove #if MEOS from tpoint_rtree.c --------- Co-authored-by: Maxime Schoemans <[email protected]>
- Loading branch information
1 parent
2eb3a7a
commit e8001e3
Showing
4 changed files
with
83 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters