|
drizzle
C++ MySQL-protocol-compatible database server
|
#include <quick_ror_intersect_select.h>
Public Member Functions | |
| QuickRorIntersectSelect (Session *session, Table *table, bool retrieve_full_rows, memory::Root *parent_alloc) | |
| int | init () |
| int | reset (void) |
| int | get_next () |
| bool | reverse_sorted () const |
| bool | unique_key_range () const |
| int | get_type () const |
| void | add_keys_and_lengths (std::string *key_names, std::string *used_lengths) |
| void | add_info_string (std::string *str) |
| bool | is_keys_used (const boost::dynamic_bitset<> &fields) |
| int | init_ror_merged_scan (bool reuse_handler) |
| void | push_quick_back (QuickRangeSelect *quick_sel_range) |
| Public Member Functions inherited from drizzled::optimizer::QuickSelectInterface | |
| virtual void | range_end () |
| virtual void | save_last_pos () |
Public Attributes | |
| std::vector< QuickRangeSelect * > | quick_selects |
| QuickRangeSelect * | cpk_quick |
| memory::Root | alloc |
| Session * | session |
| bool | need_to_fetch_row |
| bool | scans_inited |
| Public Attributes inherited from drizzled::optimizer::QuickSelectInterface | |
| bool | sorted |
| ha_rows | records |
| double | read_time |
| Table * | head |
| uint32_t | index |
| uint32_t | max_used_key_length |
| uint32_t | used_key_parts |
| unsigned char * | last_rowid |
| unsigned char * | record |
Additional Inherited Members | |
| Public Types inherited from drizzled::optimizer::QuickSelectInterface | |
| enum | { QS_TYPE_RANGE = 0 , QS_TYPE_INDEX_MERGE = 1 , QS_TYPE_RANGE_DESC = 2 , QS_TYPE_ROR_INTERSECT = 4 , QS_TYPE_ROR_UNION = 5 , QS_TYPE_GROUP_MIN_MAX = 6 } |
Rowid-Ordered Retrieval (ROR) index intersection quick select. This quick select produces intersection of row sequences returned by several QuickRangeSelects it "merges".
All merged QuickRangeSelects must return rowids in rowid order. QuickRorIntersectSelect will return rows in rowid order, too.
All merged quick selects retrieve {rowid, covered_fields} tuples (not full table records). QuickRorIntersectSelect retrieves full records if it is not being used by QuickRorIntersectSelect and all merged quick selects together don't cover needed all fields.
If one of the merged quick selects is a Clustered PK range scan, it is used only to filter rowid sequence produced by other merged quick selects.
Definition at line 50 of file quick_ror_intersect_select.h.
| drizzled::optimizer::QuickRorIntersectSelect::QuickRorIntersectSelect | ( | Session * | session, |
| Table * | table, | ||
| bool | retrieve_full_rows, | ||
| memory::Root * | parent_alloc ) |
Definition at line 37 of file quick_ror_intersect_select.cc.
| drizzled::optimizer::QuickRorIntersectSelect::~QuickRorIntersectSelect | ( | ) |
Definition at line 65 of file quick_ror_intersect_select.cc.
|
virtual |
Append text representation of quick select structure (what and how is merged) to str. The result is added to "Extra" field in EXPLAIN output.
This function is implemented only by quick selects that merge other quick selects output and/or can produce output suitable for merging.
Reimplemented from drizzled::optimizer::QuickSelectInterface.
Definition at line 233 of file quick_ror_intersect_select.cc.
|
virtual |
Append comma-separated list of keys this quick select uses to key_names; append comma-separated list of corresponding used lengths to used_lengths.
Implements drizzled::optimizer::QuickSelectInterface.
Definition at line 256 of file quick_ror_intersect_select.cc.
|
virtual |
Retrieve next record. SYNOPSIS QuickRorIntersectSelect::get_next()
NOTES Invariant on enter/exit: all intersected selects have retrieved all index records with rowid <= some_rowid_val and no intersected select has retrieved any index records with rowid > some_rowid_val. We start fresh and loop until we have retrieved the same rowid in each of the key scans or we got an error.
If a Clustered PK scan is present, it is used only to check if row satisfies its condition (and never used for row retrieval).
RETURN
| 0 | - Ok |
| other | - Error code if any error occurred. |
Implements drizzled::optimizer::QuickSelectInterface.
Definition at line 154 of file quick_ror_intersect_select.cc.
|
inlinevirtual |
Returns the type of this quick select - one of the QS_TYPE_* values
Implements drizzled::optimizer::QuickSelectInterface.
Definition at line 113 of file quick_ror_intersect_select.h.
|
virtual |
Do post-constructor initialization. SYNOPSIS QuickRorIntersectSelect::init()
RETURN
| 0 | OK |
| other | Error code |
Implements drizzled::optimizer::QuickSelectInterface.
Definition at line 81 of file quick_ror_intersect_select.cc.
|
virtual |
Initialize this quick select to be a part of a ROR-merged scan. SYNOPSIS QuickRorIntersectSelect::init_ror_merged_scan() reuse_handler If true, use head->cursor, otherwise create separate Cursor object. RETURN
| 0 | OK |
| other | error code |
Reimplemented from drizzled::optimizer::QuickSelectInterface.
Definition at line 88 of file quick_ror_intersect_select.cc.
|
virtual |
Returns true if any index used by this quick select uses field which is marked in passed bitmap.
Reimplemented from drizzled::optimizer::QuickSelectInterface.
Definition at line 143 of file quick_ror_intersect_select.cc.
| void drizzled::optimizer::QuickRorIntersectSelect::push_quick_back | ( | optimizer::QuickRangeSelect * | quick | ) |
Add a merged quick select to this ROR-intersection quick select.
SYNOPSIS QuickRorIntersectSelect::push_quick_back() quick Quick select to be added. The quick select must return rows in rowid order. NOTES This call can only be made before init() is called.
RETURN
| false | OK |
| true | Out of memory. |
Definition at line 137 of file quick_ror_intersect_select.cc.
|
virtual |
Initialize quick select for row retrieval. SYNOPSIS reset() RETURN
| 0 | OK |
| other | Error code |
Implements drizzled::optimizer::QuickSelectInterface.
Definition at line 126 of file quick_ror_intersect_select.cc.
|
inlinevirtual |
Implements drizzled::optimizer::QuickSelectInterface.
Definition at line 103 of file quick_ror_intersect_select.h.
|
inlinevirtual |
Reimplemented from drizzled::optimizer::QuickSelectInterface.
Definition at line 108 of file quick_ror_intersect_select.h.
| memory::Root drizzled::optimizer::QuickRorIntersectSelect::alloc |
Memory pool for this and merged quick selects data.
Definition at line 162 of file quick_ror_intersect_select.h.
| QuickRangeSelect* drizzled::optimizer::QuickRorIntersectSelect::cpk_quick |
Merged quick select that uses Clustered PK, if there is one. This quick select is not used for row retrieval, it is used for row retrieval.
Definition at line 160 of file quick_ror_intersect_select.h.
| bool drizzled::optimizer::QuickRorIntersectSelect::need_to_fetch_row |
if true, do retrieve full table records.
Definition at line 164 of file quick_ror_intersect_select.h.
| std::vector<QuickRangeSelect*> drizzled::optimizer::QuickRorIntersectSelect::quick_selects |
Range quick selects this intersection consists of, not including cpk_quick.
Definition at line 154 of file quick_ror_intersect_select.h.
| bool drizzled::optimizer::QuickRorIntersectSelect::scans_inited |
in top-level quick select, true if merged scans where initialized
Definition at line 166 of file quick_ror_intersect_select.h.
| Session* drizzled::optimizer::QuickRorIntersectSelect::session |
Pointer to the current session
Definition at line 163 of file quick_ror_intersect_select.h.