This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- create a database | |
create database cosmeticshop; | |
-- create a table | |
use cosmeticshop; | |
create table cosmeticshopfunnel | |
( | |
event_time TIMESTAMP, | |
event_type CHAR(18), | |
product_id CHAR(10), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- create a database with 2 master partitions | |
create database thedb partitions 2; | |
-- create sample data | |
use thedb; | |
create table data (msg varchar(200)); | |
insert into data (msg) values ('the data'); | |
-- notice how we're not using the database efficiently | |
show partitions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create database 'tpc_h'; | |
use 'tpc_h'; | |
CREATE TABLE IF NOT EXISTS `lineitem` ( | |
`l_orderkey` bigint(11) NOT NULL, | |
`l_partkey` int(11) NOT NULL, | |
`l_suppkey` int(11) NOT NULL, | |
`l_linenumber` int(11) NOT NULL, | |
`l_quantity` decimal(15,2) NOT NULL, | |
`l_extendedprice` decimal(15,2) NOT NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create database acme; | |
use acme; | |
create table customer ( | |
id int, | |
name varchar(200), | |
properties json not null, | |
key (id) using clustered columnstore | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Step_1: setup | |
Create database testDB; | |
use testDB; | |
Create table t( a int, b varchar(70)); | |
insert into t values (1, now(6)); | |
insert into t select a+(select max(a) from t), now(6) from t; | |
select count(*) from t; -- 262144 | |
-- Step_3: updates on primary | |
insert into t values (-1, now(6)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DATABASE IF NOT EXISTS hellomemsql; | |
USE hellomemsql; | |
CREATE TABLE IF NOT EXISTS messages ( | |
id BIGINT AUTO_INCREMENT PRIMARY KEY, | |
content varchar(300) NOT NULL, | |
createdate TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Step_1: setup | |
Create database testDB; | |
use testDB; | |
Create table t( a int, b varchar(70)); | |
insert into t values (1, now(6)); | |
insert into t select a+(select max(a) from t), now(6) from t; | |
select count(*) from t; | |
-- Step_3: updates on primary | |
insert into t values (-1, now(6)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: YOUR_LICENSE_KEY | |
memsql_server_version: 7.1.8 | |
package_type: rpm | |
hosts: | |
- hostname: 127.0.0.1 | |
localhost: true | |
nodes: | |
- register: false | |
role: Master | |
config: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- FULL TEXT SEARCH | |
-- ================ | |
-- setup schema | |
CREATE DATABASE library; | |
USE library; | |
CREATE TABLE books ( | |
title VARCHAR(200) not null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- TIME SERIES | |
-- =========== | |
-- setup schema | |
CREATE DATABASE temp_history; | |
USE temp_history; | |
CREATE TABLE temperatures ( | |
location VARCHAR(200) NOT NULL, |