[MDEV-17497] Reduce memory usage (query->total_size & fetch->total_size) for FTS query Created: 2018-10-19  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.0
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Major
Reporter: Thirunarayanan Balathandayuthapani Assignee: Thirunarayanan Balathandayuthapani
Resolution: Unresolved Votes: 1
Labels: None

Issue Links:
Relates
relates to MDEV-12547 InnoDB FULLTEXT index has too strict ... Closed

 Description   

Try to reduce the memory usage for FTS queries. InnoDB can remove
the f_n_char from fts_string_t.

Marko suggested few changes:

(1) Do we need both `doc_id` and `rank` in `fts_ranking_t`, or could we use a `union` of them? I assume that the two above `ib_rbt_t` are already storing either doc id or rank in the key, so we would not need to repeat that in the value.

(2) Why do we have `table_id` and `index_id` in `fts_table_t`? There already is `table` which I guess we could replace with `index`.

(3) Can we remove `fts_table_t::suffix`? And `fts_table_t::charset`?

(4) Do we need `fts_savepoint_t` with names? Savepoints are internally numbers (number of undo log records written before the savepoint).

(5) Can `fts_doc_ids_t` or `fts_trx_table_t::added_doc_ids` be simplified?

(6) `ib_uc_t` is unused. The definition could be removed.

Address all the questions above. Try to reduce memory usage without affecting performance of the query.



 Comments   
Comment by Elena Stepanova [ 2022-10-08 ]

thiru, is it still relevant?
Please update affected/fix versions if it is, or close otherwise.

Comment by Thirunarayanan Balathandayuthapani [ 2022-10-18 ]

elenst I updated the fixed version

Generated at Thu Feb 08 08:36:54 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.