MemSQL SQL reference

Every command can end with “;” (columns all in one row) or “\G” (every column on separate row).

CREATE TABLE:

  • SHARD KEY – sets column(s) for partitioning

KILL:

  • kill [ connection | query ] thread_id

KILLALL:

  • killall connections [ like ‘patterns’ ]
  • killall queries [ like ‘patterns’ ]

SHOW commands:

  • show cluster status;
  • show databases [ extended ]; – extended shows db state etc.
  • show database status;
  • show replication status;
  • show tables [ extended ]; – extended shows storage type etc.
  • show table status;
  • show columns from tablename;  (= describe tablename;)
  • show leaves; – gives list of all leaves
  • show aggregators;
    • if you have only one leave memsql most likely does not run as an aggregator
  • show partitions [ extended ]; – works only on sharded database
  • show variables;
    • show variables like “%memory%”;
  • show plancache;
  • show [ global | session ] status;
    • show status extended;

Aggregator:

  • have table information_schema.table_statistics

Memory settings:

  • maximum_memory – total memory used by memsql
  • maximum_table_memory – total memory used for tables – if reached memsql refuses new writes