Server System Variables This variable limits the total number of prepared statements in the server. It can be used in environments where there is the potential for denial-of-service attacks based on running the server out of memory by preparing huge numbers of statements. If the value is set lower than the current number of prepared statements, existing statements are not affected and can be used, but no new statements can be prepared until the current number drops below the limit. Setting the value to 0 disables prepared statements. Limit the assumed maximum number of seeks when looking up rows based on a key. The MySQL optimizer assumes that no more than this number of key seeks are required when searching for matching rows in a table by scanning an index, regardless of the actual cardinality of the index (see Section 13.7.7.22, “SHOW INDEX Statement” ). By setting this to a low value (say, 100), you can force MySQL to prefer indexes instead of table scans. System Variable max_prepared_stmt_count Scope Global Dynamic Yes SET_VAR  Hint Applies No Type Integer Default Value 16382 Minimum Value 0 Maximum Value ( ≥  8.0.18) 4194304 Maximum Value ( ≤  8.0.17) 1048576 Command-Line Format --max-seeks-for-key=# System Variable max_seeks_for_key Scope Global, Session Dynamic Yes SET_VAR  Hint Applies Yes Type Integer Default Value (Windows) 4294967295 Default Value (Other, 64-bit platforms) 18446744073709551615 Default Value (Other, 32-bit platforms) 4294967295 Minimum Value 1 Maximum Value (Windows) 4294967295 Maximum Value (Other, 64-bit platforms) 18446744073709551615 Maximum Value (Other, 32-bit platforms) 4294967295 Command-Line Format --max-sort-length=# System Variable max_sort_length Scope Global, Session Dynamic Yes 834 • max_seeks_for_key • max_sort_length