HANDLER per le tabelle MEMORY

Stai visualizzando una vecchia versione di questo article. Visualizza la versione più recente.

Questo articolo spiega come utilizzare i comandi HANDLER in maniera efficiente sulle tabelle MEMORY|HEAP.

Se si desidera effettuare delle scansioni sulle chiavi, non una solo semplici ricerche su un valore preciso, è meglio creare le chiavi utilizzando 'USING BTREE':

CREATE TABLE t1 (a INT, b INT, KEY(a), KEY b USING BTREE (b)) engine=memory;

Nella tabella di esempio, a è una chiave HASH che supporta solo le ricerche esatte (=), mentre b è una chiave BTREE, utilizzabili per scansire le tabelle nell'ordine definito dalla chiave, cominciando dall'inizio oppure da un dato valore.

Le limitazioni di HANDLER READ con le tabelle Memory|HEAP sono le seguenti:

Limitations for HASH keys:

  • You must use all key parts when searching for a row.
  • You can't do a key scan of all values. You can only find all rows with the same key value.
  • READ NEXT gives error 1031 if the tables changed since last read.

Limitations for BTREE keys:

  • READ NEXT gives error 1031 if the tables changed since last read. This limitation can be lifted in the future.

Limitations for table scans:

  • READ NEXT gives error 1031 if the table was truncated since last READ call.

See also

See also the the limitations listed in HANDLER commands.

Commenti

Sto caricando i commenti......
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.