Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDEV-33408 Introduce session variables to manage HNSW index parameters #3226

Open
wants to merge 28 commits into
base: bb-11.4-vec-vicentiu-hugo
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7b87e01
MDEV-32885 VEC_DISTANCE() function
vuvova Nov 25, 2023
ed8b6da
make INFORMATION_SCHEMA.STATISTICS.COMMENT not nullable
vuvova Jan 19, 2024
4bea056
fix main.plugin_vars test to cleanup after itself
vuvova Feb 5, 2024
62e6031
cleanup: spaces, casts, comments
vuvova Jan 8, 2024
e409868
cleanup: pass TABLE_SHARE to store_key_options()
vuvova Jan 26, 2024
bc8a7a3
reject invalid spatial key declarations in the parser
vuvova Jan 8, 2024
16846b5
cleanup: remove unconditional #ifdef's
vuvova Jan 10, 2024
2cd2320
cleanup: lex_string_set3()
vuvova Jan 27, 2024
8ddb99a
cleanup: Queue and Bounded_queue
vuvova Feb 6, 2024
ef14f42
cleanup: key algorithm vs key flags
vuvova Jan 14, 2024
022bc34
cleanup: make_long_hash_field_name() and add_hash_field()
vuvova Jan 18, 2024
38e84a8
cleanup: generalize ER_SPATIAL_CANT_HAVE_NULL
vuvova Jan 17, 2024
f1d0352
cleanup: generalize ER_INNODB_NO_FT_TEMP_TABLE
vuvova Jan 25, 2024
0cbd050
cleanup: extract ha_create_table_from_share()
vuvova Jan 25, 2024
cdcf739
open frm for DROP TABLE
vuvova Jan 26, 2024
3fa8be1
cleanup: unused function argument
vuvova Jan 26, 2024
cc82b35
Revert "MDEV-15458 Segfault in heap_scan() upon UPDATE after ADD SYST…
vuvova Feb 9, 2024
a857b68
initial support for vector indexes
vuvova Jan 17, 2024
9ca6554
Initial fixup
cvicentiu Feb 17, 2024
1568677
Wip
cvicentiu Feb 21, 2024
e944876
Graph insert possibly working ok
cvicentiu Feb 22, 2024
b34a896
Search is now working, but layer unaware
cvicentiu Feb 22, 2024
8aa7c1e
wip
cvicentiu Feb 22, 2024
3d0e4ea
Vec insert and search working on a multi-layer
cvicentiu Feb 23, 2024
437e214
MDEV-33408 Alter HNSW graph storage and fix memory leak
HugoWenTD Apr 12, 2024
ee2cc47
Support files for ann-workspace
cvicentiu Apr 15, 2024
7829259
Bug fixes - on top of Hugo's patch
cvicentiu Apr 18, 2024
5899540
Introduce session variables to manage HNSW index parameters
HugoWenTD Apr 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup: remove unconditional #ifdef's
  • Loading branch information
vuvova authored and cvicentiu committed Apr 4, 2024
commit 16846b5d0c75a9b9ac53c13e272f8b5fded2e93b
8 changes: 0 additions & 8 deletions config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -501,14 +501,6 @@
#cmakedefine HAVE_EncryptAes128Gcm 1
#cmakedefine HAVE_hkdf 1

/*
Stuff that always need to be defined (compile breaks without it)
*/
#define HAVE_SPATIAL 1
#define HAVE_RTREE_KEYS 1
#define HAVE_QUERY_CACHE 1
#define BIG_TABLES 1

/*
Important storage engines (those that really need define
WITH_<ENGINE>_STORAGE_ENGINE for the whole server)
Expand Down
5 changes: 0 additions & 5 deletions include/my_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -666,13 +666,8 @@ typedef struct st_page_range
#define unused_page_range { UNUSED_PAGE_NO, UNUSED_PAGE_NO }

/* For number of records */
#ifdef BIG_TABLES
#define rows2double(A) ulonglong2double(A)
typedef my_off_t ha_rows;
#else
#define rows2double(A) (double) (A)
typedef ulong ha_rows;
#endif

#define HA_POS_ERROR (~ (ha_rows) 0)
#define HA_OFFSET_ERROR (~ (my_off_t) 0)
Expand Down
6 changes: 0 additions & 6 deletions include/myisampack.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,8 @@

/* Fix to avoid warnings when sizeof(ha_rows) == sizeof(long) */

#ifdef BIG_TABLES
#define mi_rowstore(T,A) mi_int8store(T, A)
#define mi_rowkorr(T) mi_uint8korr(T)
#else
#define mi_rowstore(T,A) { mi_int4store(T, 0);\
mi_int4store(((uchar*) (T) + 4), A); }
#define mi_rowkorr(T) mi_uint4korr((const uchar*) (T) + 4)
#endif

#if SIZEOF_OFF_T > 4
#define mi_sizestore(T,A) mi_int8store(T, A)
Expand Down
4 changes: 0 additions & 4 deletions libmysqld/emb_qcache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "mariadb.h"
#include "sql_priv.h"

#ifdef HAVE_QUERY_CACHE
#include <mysql.h>
#include "sql_basic_types.h"
#include "emb_qcache.h"
Expand Down Expand Up @@ -497,6 +496,3 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src)
err:
DBUG_RETURN(1);
}

#endif /*HAVE_QUERY_CACHE*/

4 changes: 0 additions & 4 deletions sql/cset_narrowing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

#include "mariadb.h"
#include "sql_priv.h"
#include "sql_select.h"
Expand Down
4 changes: 0 additions & 4 deletions sql/debug_sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
Declarations for the Debug Sync Facility. See debug_sync.cc for details.
*/

#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif

class THD;

#if defined(ENABLED_DEBUG_SYNC)
Expand Down
4 changes: 0 additions & 4 deletions sql/field.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
This file implements classes defined in field.h
*/

#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

#include "mariadb.h"
#include "sql_priv.h"
#include "sql_select.h"
Expand Down
4 changes: 0 additions & 4 deletions sql/field.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
variables must declare the size_of() member function.
*/

#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif

#include "mysqld.h" /* system_charset_info */
#include "table.h" /* TABLE */
#include "sql_string.h" /* String */
Expand Down
5 changes: 0 additions & 5 deletions sql/gcalc_slicescan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#include <my_sys.h>
#include <m_string.h>

#ifdef HAVE_SPATIAL

#include "gcalc_slicescan.h"


Expand Down Expand Up @@ -2010,6 +2008,3 @@ double Gcalc_scan_iterator::get_pure_double(const Gcalc_internal_coord *d,
res*= -1.0;
return res;
}


#endif /* HAVE_SPATIAL */
5 changes: 0 additions & 5 deletions sql/gcalc_tools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

#include "mariadb.h"

#ifdef HAVE_SPATIAL

#include "gcalc_tools.h"
#include "spatial.h"

Expand Down Expand Up @@ -1466,6 +1464,3 @@ void Gcalc_operation_reducer::reset()
m_res_hook= (Gcalc_dyn_list::Item **)&m_result;
free_list(m_first_active_thread);
}

#endif /*HAVE_SPATIAL*/

2 changes: 0 additions & 2 deletions sql/handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2160,10 +2160,8 @@ commit_one_phase_2(THD *thd, bool all, THD_TRANS *trans, bool is_real_trans)
trans->no_2pc=0;
if (all)
{
#ifdef HAVE_QUERY_CACHE
if (thd->transaction->changed_tables)
query_cache.invalidate(thd, thd->transaction->changed_tables);
#endif
}
}

Expand Down
4 changes: 0 additions & 4 deletions sql/handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@

/* Definitions for parameters to do with handler-routines */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif

#include "sql_const.h"
#include "sql_basic_types.h"
#include "mysqld.h" /* server_id */
Expand Down
4 changes: 0 additions & 4 deletions sql/hash_filo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
** to usage.
*/

#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

#include "mariadb.h"
#include "sql_priv.h"
#include "hash_filo.h"
Expand Down
4 changes: 0 additions & 4 deletions sql/hash_filo.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
#ifndef HASH_FILO_H
#define HASH_FILO_H

#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class interface */
#endif

#include "hash.h" /* my_hash_get_key, my_hash_free_key, HASH */
#include "m_string.h" /* bzero */
#include "mysqld.h" /* key_hash_filo_lock */
Expand Down
4 changes: 0 additions & 4 deletions sql/item.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */


#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
#include "mariadb.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include <mysql.h>
Expand Down
5 changes: 0 additions & 5 deletions sql/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */


#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif

#include "sql_priv.h" /* STRING_BUFFER_USUAL_SIZE */
#include "unireg.h"
#include "sql_const.h" /* RAND_TABLE_BIT, MAX_FIELD_NAME */
Expand Down
4 changes: 0 additions & 4 deletions sql/item_cmpfunc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
This file defines all compare functions
*/

#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

#include "mariadb.h"
#include "sql_priv.h"
#include <m_ctype.h>
Expand Down
4 changes: 0 additions & 4 deletions sql/item_cmpfunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@

/* compare and test functions */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif

#include "item_func.h" /* Item_int_func, Item_bool_func */
#include "item.h"
#include "opt_rewrite_date_cmp.h"
Expand Down
8 changes: 0 additions & 8 deletions sql/item_create.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ get_native_fct_hash_key(const uchar *buff, size_t *length,
}


#ifdef HAVE_SPATIAL
extern Native_func_registry_array native_func_registry_array_geom;
#endif


/*
Expand Down Expand Up @@ -6622,20 +6620,16 @@ Native_functions_hash::find(THD *thd, const LEX_CSTRING &name) const
int item_create_init()
{
size_t count= native_func_registry_array.count();
#ifdef HAVE_SPATIAL
count+= native_func_registry_array_geom.count();
#endif

if (native_functions_hash.init(count) ||
native_functions_hash.append(native_func_registry_array.elements(),
native_func_registry_array.count()))
return true;

#ifdef HAVE_SPATIAL
if (native_functions_hash.append(native_func_registry_array_geom.elements(),
native_func_registry_array_geom.count()))
return true;
#endif

count+= oracle_func_registry_array.count();

Expand All @@ -6644,11 +6638,9 @@ int item_create_init()
native_func_registry_array.count()))
return true;

#ifdef HAVE_SPATIAL
if (native_functions_hash_oracle.append(native_func_registry_array_geom.elements(),
native_func_registry_array_geom.count()))
return true;
#endif

return
native_functions_hash_oracle.replace(oracle_func_registry_array.elements(),
Expand Down
4 changes: 0 additions & 4 deletions sql/item_func.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
This file defines all numerical functions
*/

#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

#include "sql_plugin.h"
#include "sql_priv.h"
/*
Expand Down
4 changes: 0 additions & 4 deletions sql/item_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@

/* Function items used by mysql */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif

#ifdef HAVE_IEEEFP_H
extern "C" /* Bug in BSDI include file */
{
Expand Down
7 changes: 0 additions & 7 deletions sql/item_geofunc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
This file defines all spatial functions
*/

#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

#include "mariadb.h"
#include "sql_priv.h"
/*
Expand All @@ -35,7 +31,6 @@
*/
#include "sql_class.h" // THD, set_var.h: THD
#include "set_var.h"
#ifdef HAVE_SPATIAL
#include <m_ctype.h>
#include "opt_range.h"
#include "item_geofunc.h"
Expand Down Expand Up @@ -4078,5 +4073,3 @@ static Native_func_registry func_array_geom[] =
Native_func_registry_array
native_func_registry_array_geom(func_array_geom,
array_elements(func_array_geom));

#endif /*HAVE_SPATIAL*/
12 changes: 0 additions & 12 deletions sql/item_geofunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@

/* This file defines all spatial functions */

#ifdef HAVE_SPATIAL

#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif

#include "sql_type_geom.h"
#include "item.h"
#include "gstream.h"
Expand Down Expand Up @@ -1279,10 +1273,4 @@ class Item_func_gis_debug: public Item_long_func
#define GEOM_NEW(thd, obj_constructor) new (thd->mem_root) obj_constructor
#define GEOM_TYPE(x) (x)

#else /*HAVE_SPATIAL*/

#define GEOM_NEW(thd, obj_constructor) NULL
#define GEOM_TYPE(x) NULL

#endif /*HAVE_SPATIAL*/
#endif /* ITEM_GEOFUNC_INCLUDED */
4 changes: 0 additions & 4 deletions sql/item_strfunc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
(This shouldn't be needed)
*/

#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

#include "mariadb.h" // HAVE_*

#include "sql_priv.h"
Expand Down
4 changes: 0 additions & 4 deletions sql/item_strfunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@

/* This file defines all string functions */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif

extern size_t username_char_length;

class Item_str_func :public Item_func
Expand Down
4 changes: 0 additions & 4 deletions sql/item_subselect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
methods (sql_select.h/sql_select.cc)
*/

#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

#include "mariadb.h"
#include "sql_priv.h"
/*
Expand Down
4 changes: 0 additions & 4 deletions sql/item_subselect.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@

/* subselect Item */

#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif

#include <queues.h>

class st_select_lex;
Expand Down
4 changes: 0 additions & 4 deletions sql/item_sum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
Sum functions (COUNT, MIN...)
*/

#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif

#include "mariadb.h"
#include "sql_priv.h"
#include "sql_select.h"
Expand Down