mariadb/mysys
Sergei Golubchik 049d839350 mhnsw: inter-statement shared cache
* preserve the graph in memory between statements
* keep it in a TABLE_SHARE, available for concurrent searches
* nodes are generally read-only, walking the graph doesn't change them
* distance to target is cached, calculated only once
* SIMD-optimized bloom filter detects visited nodes
* nodes are stored in an array, not List, to better utilize bloom filter
* auto-adjusting heuristic to estimate the number of visited nodes
  (to configure the bloom filter)
* many threads can concurrently walk the graph. MEM_ROOT and Hash_set
  are protected with a mutex, but walking doesn't need them
* up to 8 threads can concurrently load nodes into the cache,
  nodes are partitioned into 8 mutexes (8 is chosen arbitrarily, might
  need tuning)
* concurrent editing is not supported though
* this is fine for MyISAM, TL_WRITE protects the TABLE_SHARE and the
  graph (note that TL_WRITE_CONCURRENT_INSERT is not allowed, because an
  INSERT into the main table means multiple UPDATEs in the graph)
* InnoDB uses secondary transaction-level caches linked in a list in
  in thd->ha_data via a fake handlerton
* on rollback the secondary cache is discarded, on commit nodes
  from the secondary cache are invalidated in the shared cache
  while it is exclusively locked
* on savepoint rollback both caches are flushed. this can be improved
  in the future with a row visibility callback
* graph size is controlled by @@mhnsw_cache_size, the cache is flushed
  when it reaches the threshold
2024-11-05 14:00:49 -08:00
..
crc32
array.c
base64.c
ChangeLog
charset-def.c
charset.c
CMakeLists.txt
crc32ieee.cc
errors.c
file_logger.c
get_password.c
guess_malloc_library.c
hash.c
lf_alloc-pin.c
lf_dynarray.c
lf_hash.cc
list.c
ma_dyncol.c
mf_arr_appstr.c
mf_cache.c
mf_dirname.c
mf_fn_ext.c
mf_format.c
mf_getdate.c
mf_iocache.c
mf_iocache2.c
mf_keycache.c
mf_keycaches.c
mf_loadpath.c
mf_pack.c
mf_path.c
mf_qsort.c
mf_qsort2.c
mf_radix.c
mf_same.c
mf_sort.c
mf_soundex.c
mf_tempdir.c
mf_tempfile.c
mf_unixpath.c
mf_wcomp.c
mulalloc.c
my_access.c
my_addr_resolve.c
my_alloc.c
my_atomic_writes.c
my_basename.c
my_bit.c
my_bitmap.c
my_chmod.c
my_chsize.c
my_compare.c
my_compress.c
my_copy.c
my_cpu.c
my_create.c
my_default.c
my_delete.c
my_div.c
my_dlerror.c
my_error.c
my_file.c
my_fopen.c
my_fstream.c
my_gethwaddr.c
my_getncpus.c
my_getopt.c
my_getpagesize.c
my_getsystime.c
my_getwd.c
my_init.c
my_largepage.c
my_lib.c
my_libwrap.c
my_likely.c
my_lock.c
my_lockmem.c
my_malloc.c
my_memmem.c
my_mess.c
my_minidump.cc
my_mkdir.c
my_mmap.c
my_new.cc
my_once.c
my_open.c
my_port.c
my_pread.c
my_pthread.c
my_quick.c
my_rdtsc.c
my_read.c
my_redel.c
my_rename.c
my_rnd.c
my_safehash.c
my_safehash.h
my_seek.c
my_setuser.c
my_sleep.c
my_static.c
my_static.h
my_symlink.c
my_symlink2.c
my_sync.c
my_thr_init.c
my_thread_name.cc
my_timezone.cc
my_uuid.c
my_win_popen.cc
my_wincond.c
my_winerr.c
my_winfile.c
my_winthread.c
my_wintoken.c
my_write.c
mysys_priv.h
psi_noop.c
ptr_cmp.c
queues.c
safemalloc.c
stacktrace.c
string.c
test_charset.c
test_dir.c
test_thr_mutex.c
test_xml.c
testhash.c
thr_lock.c
thr_mutex.c
thr_rwlock.c
thr_timer.c
tree.c
typelib.c
waiting_threads.c
wqueue.c