~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/unique.cc

  • Committer: Stewart Smith
  • Date: 2010-09-23 05:33:01 UTC
  • mto: (1804.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1806.
  • Revision ID: stewart@flamingspork.com-20100923053301-b2b528g2dm5owa97
HailDB test suite loads the HailDB plugin (not the old name, which was 'embedded_innodb')

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
/*
17
17
  Function to handle quick removal of duplicates
26
26
  deletes in disk order.
27
27
*/
28
28
 
29
 
#include <config.h>
 
29
#include "config.h"
30
30
 
31
31
#include <math.h>
32
32
 
33
33
#include <queue>
34
34
 
35
 
#include <drizzled/sql_sort.h>
36
 
#include <drizzled/session.h>
37
 
#include <drizzled/sql_list.h>
38
 
#include <drizzled/internal/iocache.h>
39
 
#include <drizzled/unique.h>
 
35
#include "drizzled/sql_sort.h"
 
36
#include "drizzled/session.h"
 
37
#include "drizzled/sql_list.h"
 
38
#include "drizzled/internal/iocache.h"
40
39
 
41
40
#if defined(CMATH_NAMESPACE)
42
41
using namespace CMATH_NAMESPACE;
139
138
*/
140
139
 
141
140
double Unique::get_use_cost(uint32_t *, uint32_t nkeys, uint32_t key_size,
142
 
                            size_t max_in_memory_size_arg)
 
141
                            size_t max_in_memory_size)
143
142
{
144
143
  ulong max_elements_in_tree;
145
144
  ulong last_tree_elems;
146
145
  double result;
147
146
 
148
 
  max_elements_in_tree= ((ulong) max_in_memory_size_arg /
 
147
  max_elements_in_tree= ((ulong) max_in_memory_size /
149
148
                         ALIGN_SIZE(sizeof(TREE_ELEMENT)+key_size));
150
149
 
151
150
  last_tree_elems= nkeys % max_elements_in_tree;