Drizzled Public API Documentation

quick_ror_union_select.h

00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2008-2009 Sun Microsystems, Inc.
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; version 2 of the License.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018  */
00019 
00020 #pragma once
00021 
00022 #include <drizzled/optimizer/range.h>
00023 
00024 #include <vector>
00025 
00026 namespace drizzled
00027 {
00028 
00029 namespace optimizer
00030 {
00031 
00032 class compare_functor;
00033 
00046 class QuickRorUnionSelect : public QuickSelectInterface
00047 {
00048 public:
00049   QuickRorUnionSelect(Session *session, Table *table);
00050   ~QuickRorUnionSelect();
00051 
00061   int  init();
00062 
00072   int  reset(void);
00073 
00088   int  get_next();
00089 
00090   bool reverse_sorted() const
00091   {
00092     return false;
00093   }
00094 
00095   bool unique_key_range() const
00096   {
00097     return false;
00098   }
00099 
00100   int get_type() const
00101   {
00102     return QS_TYPE_ROR_UNION;
00103   }
00104 
00105   void add_keys_and_lengths(std::string *key_names, std::string *used_lengths);
00106   void add_info_string(std::string *str);
00107   bool is_keys_used(const boost::dynamic_bitset<>& fields);
00108 
00109   bool push_quick_back(QuickSelectInterface *quick_sel_range);
00110 
00111   std::vector<QuickSelectInterface *> quick_selects; 
00114   std::priority_queue<QuickSelectInterface *, std::vector<QuickSelectInterface *>, compare_functor > *queue;
00115   memory::Root alloc; 
00117   Session *session; 
00118   unsigned char *cur_rowid; 
00119   unsigned char *prev_rowid; 
00120   bool have_prev_rowid; 
00121   uint32_t rowid_length; 
00122 private:
00123   bool scans_inited;
00124 };
00125 
00126 } /* namespace optimizer */
00127 
00128 } /* namespace drizzled */
00129