2011-12-02 18:58:12 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2010, Swedish Institute of Computer Science
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. Neither the name of the Institute nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file
|
|
|
|
* Database configuration options.
|
|
|
|
* \author
|
|
|
|
* Nicolas Tsiftes <nvt@sics.se>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DB_OPTIONS_H
|
|
|
|
#define DB_OPTIONS_H
|
|
|
|
|
|
|
|
#include "contiki-conf.h"
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
/* Optional Antelope features. Include only what is needed
|
|
|
|
in order to save space. */
|
|
|
|
|
|
|
|
/* Support join operations on relations. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_FEATURE_JOIN
|
|
|
|
#define DB_FEATURE_JOIN 1
|
|
|
|
#endif /* DB_FEATURE_JOIN */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* Support tuple removals. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_FEATURE_REMOVE
|
|
|
|
#define DB_FEATURE_REMOVE 1
|
|
|
|
#endif /* DB_FEATURE_REMOVE */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* Support floating-point values in attributes. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_FEATURE_FLOATS
|
|
|
|
#define DB_FEATURE_FLOATS 0
|
|
|
|
#endif /* DB_FEATURE_FLOATS */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* Optimize storage access for the Coffee file system. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_FEATURE_COFFEE
|
|
|
|
#define DB_FEATURE_COFFEE 1
|
|
|
|
#endif /* DB_FEATURE_COFFEE */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* Enable basic data integrity checks. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_FEATURE_INTEGRITY
|
|
|
|
#define DB_FEATURE_INTEGRITY 0
|
|
|
|
#endif /* DB_FEATURE_INTEGRITY */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2011-12-02 18:58:12 +01:00
|
|
|
|
|
|
|
/* Configuration parameters that may be trimmed to save space. */
|
2012-10-30 01:56:23 +01:00
|
|
|
|
|
|
|
/* The size of the error message buffer used by the parser. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_ERROR_BUF_SIZE
|
|
|
|
#define DB_ERROR_BUF_SIZE 50
|
|
|
|
#endif /* DB_ERROR_BUF_SIZE */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The maximum number of indexes in use by all relations loaded in memory. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_INDEX_POOL_SIZE
|
|
|
|
#define DB_INDEX_POOL_SIZE 3
|
|
|
|
#endif /* DB_INDEX_POOL_SIZE */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The maximum number of relations loaded in memory. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_RELATION_POOL_SIZE
|
|
|
|
#define DB_RELATION_POOL_SIZE 5
|
|
|
|
#endif /* DB_RELATION_POOL_SIZE */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The maximum number of attributes loaded in memory. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_ATTRIBUTE_POOL_SIZE
|
|
|
|
#define DB_ATTRIBUTE_POOL_SIZE 16
|
|
|
|
#endif /* DB_ATTRIBUTE_POOL_SIZE */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The maximum number of attributes in a relation. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_MAX_ATTRIBUTES_PER_RELATION
|
|
|
|
#define DB_MAX_ATTRIBUTES_PER_RELATION 6
|
|
|
|
#endif /* DB_MAX_ATTRIBUTES_PER_RELATION */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The maximum physical storage size on an attribute value. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_MAX_ELEMENT_SIZE
|
|
|
|
#define DB_MAX_ELEMENT_SIZE 16
|
|
|
|
#endif /* DB_MAX_ELEMENT_SIZE */
|
|
|
|
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The maximum size of the LVM bytecode compiled from a
|
|
|
|
single database query. */
|
2012-06-04 19:44:08 +02:00
|
|
|
#ifndef DB_VM_BYTECODE_SIZE
|
|
|
|
#define DB_VM_BYTECODE_SIZE 128
|
|
|
|
#endif /* DB_VM_BYTECODE_SIZE */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2011-12-02 18:58:12 +01:00
|
|
|
/* Language options. */
|
2012-10-30 01:56:23 +01:00
|
|
|
|
|
|
|
/* The maximum length of a database query in AQL text format. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef AQL_MAX_QUERY_LENGTH
|
|
|
|
#define AQL_MAX_QUERY_LENGTH 128
|
|
|
|
#endif /* AQL_MAX_QUERY_LENGTH */
|
|
|
|
|
|
|
|
#ifndef AQL_MAX_VALUE_LENGTH
|
|
|
|
#define AQL_MAX_VALUE_LENGTH DB_MAX_ELEMENT_SIZE
|
|
|
|
#endif /* AQL_MAX_VALUE_LENGTH */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The maximum number of relations used in a single query. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef AQL_RELATION_LIMIT
|
|
|
|
#define AQL_RELATION_LIMIT 3
|
|
|
|
#endif /* AQL_RELATION_LIMIT */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The maximum number of attributes used in a single query. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef AQL_ATTRIBUTE_LIMIT
|
|
|
|
#define AQL_ATTRIBUTE_LIMIT 5
|
|
|
|
#endif /* AQL_ATTRIBUTE_LIMIT */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2011-12-02 18:58:12 +01:00
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/*
|
|
|
|
* Physical storage options. Changing these options might cause
|
|
|
|
* compatibility problems if the database files are moved between
|
|
|
|
* different installations of Antelope.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* The default relation file size to reserve when using Coffee. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_COFFEE_RESERVE_SIZE
|
|
|
|
#define DB_COFFEE_RESERVE_SIZE (128 * 1024UL)
|
|
|
|
#endif /* DB_COFFEE_RESERVE_SIZE */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The maximum size of the physical storage of a tuple (labelled a "row"
|
|
|
|
in Antelope's terminology. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_MAX_CHAR_SIZE_PER_ROW
|
|
|
|
#define DB_MAX_CHAR_SIZE_PER_ROW 64
|
|
|
|
#endif /* DB_MAX_CHAR_SIZE_PER_ROW */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The maximum file name length to use for creating various database file. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_MAX_FILENAME_LENGTH
|
|
|
|
#define DB_MAX_FILENAME_LENGTH 16
|
|
|
|
#endif /* DB_MAX_FILENAME_LENGTH */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The maximum length of an attribute name. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef ATTRIBUTE_NAME_LENGTH
|
|
|
|
#define ATTRIBUTE_NAME_LENGTH 12
|
|
|
|
#endif /* ATTRIBUTE_NAME_LENGTH */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The maximum length on a relation name. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef RELATION_NAME_LENGTH
|
|
|
|
#define RELATION_NAME_LENGTH 10
|
|
|
|
#endif /* RELATION_NAME_LENGTH */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The name of the intermediate "result" relation file, which is used
|
|
|
|
for presenting the result of a query to a user. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef RESULT_RELATION
|
|
|
|
#define RESULT_RELATION "db-result"
|
|
|
|
#endif /* RESULT_RELATION */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The name of the relation used for processing a REMOVE query. */
|
|
|
|
#ifndef REMOVE_RELATION
|
|
|
|
#define REMOVE_RELATION "db-remove"
|
|
|
|
#endif /* REMOVE_RELATION */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2011-12-02 18:58:12 +01:00
|
|
|
|
|
|
|
/* Index options. */
|
2012-10-30 01:56:23 +01:00
|
|
|
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_INDEX_COST
|
|
|
|
#define DB_INDEX_COST 64
|
|
|
|
#endif /* DB_INDEX_COST */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The maximum number of hash table indexes. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_MEMHASH_INDEX_LIMIT
|
|
|
|
#define DB_MEMHASH_INDEX_LIMIT 1
|
|
|
|
#endif /* DB_MEMHASH_INDEX_LIMIT */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The default hash table index size. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_MEMHASH_TABLE_SIZE
|
|
|
|
#define DB_MEMHASH_TABLE_SIZE 61
|
|
|
|
#endif /* DB_MEMHASH_TABLE_SIZE */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The maximum number of Maxheap indexes. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_HEAP_INDEX_LIMIT
|
|
|
|
#define DB_HEAP_INDEX_LIMIT 1
|
|
|
|
#endif /* DB_HEAP_INDEX_LIMIT */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The maximum number of buckets cached in the MaxHeap index. */
|
2011-12-02 18:58:12 +01:00
|
|
|
#ifndef DB_HEAP_CACHE_LIMIT
|
|
|
|
#define DB_HEAP_CACHE_LIMIT 1
|
|
|
|
#endif /* DB_HEAP_CACHE_LIMIT */
|
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
/* LVM options. */
|
2011-12-02 18:58:12 +01:00
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The maximum length of a variable in LVM. This value should preferably
|
|
|
|
be identical to the maximum attribute name length. */
|
|
|
|
#ifndef LVM_MAX_NAME_LENGTH
|
|
|
|
#define LVM_MAX_NAME_LENGTH ATTRIBUTE_NAME_LENGTH
|
|
|
|
#endif /* LVM_MAX_NAME_LENGTH */
|
2011-12-02 18:58:12 +01:00
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* The maximum variable identifier number in the LVM. The default
|
|
|
|
value corresponds to the highest attribute ID. */
|
|
|
|
#ifndef LVM_MAX_VARIABLE_ID
|
|
|
|
#define LVM_MAX_VARIABLE_ID AQL_ATTRIBUTE_LIMIT - 1
|
|
|
|
#endif /* LVM_MAX_VARIABLE_ID */
|
2011-12-02 18:58:12 +01:00
|
|
|
|
2012-10-30 01:56:23 +01:00
|
|
|
/* Specify whether floats should be used or not inside the LVM. */
|
|
|
|
#ifndef LVM_USE_FLOATS
|
|
|
|
#define LVM_USE_FLOATS DB_FEATURE_FLOATS
|
|
|
|
#endif /* LVM_USE_FLOATS */
|
2011-12-02 18:58:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* !DB_OPTIONS_H */
|