SlideShare a Scribd company logo
MemSQL 201: Advanced Tips & Tricks
Alec Powell, Solutions Engineer, MemSQL
January 2018
alec@memsql.com
Webinar Agenda
Rowstore vs Columnstore
Data Ingestion
Data Sharding & Query Tuning
Memory & Workload Management
Rowstore vs Columnstore
Making the most of MemSQL’s two
storage models
Streaming Database
Real-Time Pipelines, OLTP, and OLAP
Real-time
Pipelines
High Volume
Transactions
OLTP
Fast, Scalable
SQL Analytics
OLAP
Data
Warehouse
Streaming Database
MemSQL Features Multiple Table Types
Memory and
Disk Columnstore
In-Memory
Rowstore
Data
Warehouse
Streaming Database
The Rowstore and Columnstore Span Memory to Disk
Memory and
Disk Columnstore
RAM and SSDs
In-Memory
Rowstore
RAM
Relational
JSON
Key Value
Geospatial
Data
Warehouse
Streaming Database
Both Table Types are Persistent
Memory and
Disk Columnstore
SSDs and HDDs
In-Memory
Rowstore
Persists
to SSD for
durability
Data
Warehouse
In-Memory Rowstore Flash, SSD or Disk-based Columnstore
Operational/transactional workloads Analytical workloads
Single-record insert performance Batched load performance
Random seek performance Fast aggregations and table scans
Updates are frequent Updates are rare
Any types of deletes Deletes that remove large # of rows
MemSQL allows joining rowstore and columnstore data in a single query
When to use Rowstore and Columnstore
Our star schema
Example Query
SELECT
dim_supplier.supplier_address,
SUM(fact_supply_order.quantity) AS quantity_sold
FROM
fact_supply_order
INNER JOIN dim_product ON fact_supply_order.product_id = dim_product.product_id
INNER JOIN dim_time ON fact_supply_order.time_id = dim_time.time_id
INNER JOIN dim_supplier ON fact_supply_order.supplier_id = dim_supplier.supplier_id
WHERE
dim_time.action_year = 2016
AND dim_supplier.city = ‘Topeka’
AND dim_product.product_type = ‘Aspirin’
GROUP BY
dim_supplier.supplier_id,
dim_supplier.supplier_address;
Columnstore sort key
memsql> CREATE TABLE fact_supply_order (
-> product_id INT PRIMARY KEY,
-> time_id INT,
-> supplier_id INT,
-> employee_id INT,
-> price DECIMAL(8,2),
-> quantity DECIMAL(8,2),
-> KEY (time_id, product_id, supplier_id)
-> USING CLUSTERED COLUMNSTORE);
MemSQL 201: Advanced Tips and Tricks Webcast
Data Ingestion
Real-time data loading with
MemSQL Pipelines
Streaming Database
Real-Time
Pipelines
MemSQL Pipelines Simplifies Real-Time Data Pipelines
ColumnstoreRowstore
Data
Warehouse
Streaming Database
Stream into the Rowstore or Columnstore
Real-Time
Pipelines
streams directly
into the Rowstore
or the Columnstore
ColumnstoreRowstore
Data
Warehouse
Pipelines enables partition-level Parallelism
Leaf 1
Leaf 2
Leaf 3
Leaf 4
Loading our table using S3 Pipelines
memsql> CREATE PIPELINE orders_pipeline AS
-> LOAD DATA S3 ”deloy.test/alec/orders-history”
-> CREDENTIALS ‘{redacted}’
-> SKIP ALL ERRORS
-> INTO TABLE fact_supply_order;
Query OK, (0.89 sec)
memsql> START PIPELINE orders_pipeline;
Query OK, (0.01 sec)
memsql> SELECT count(*) from fact_supply_order;
Sharding & Query Tuning
Understanding the distributed
system
MemSQL has aggregator and leaf nodes
LeafLeafLeafLeaf
Agg
Aggregator
Master
Aggregator
Database clients connect to aggregators
AggregatorAggregator
LeafLeafLeafLeaf
PARTITIONS PARTITIONS PARTITIONS PARTITIONS
Database Client
Leaf nodes store and process data in partitions
AggregatorAggregator
LeafLeafLeafLeaf
PARTITIONS PARTITIONS PARTITIONS PARTITIONS
Designing a Schema: Shard Keys
 Every distributed table has 1 shard key
• Non-unique key OK (eg. SHARD KEY (id, click_id, user_id))
 Determines the partition to which a row belongs
 If not specified, PRIMARY KEY is used.
 If no primary key, it will be empty (i.e. randomly distribute).
 Equality on all shard key columns → single partition query
 Most queries are not like this → query all partitions
HASH(“12345”) % NUM_PARTITIONS = 17
Great for Analytical Queries:
 Large aggregations
 Parallel processing
Critical for Transactional Queries:
 Selecting Single Rows
 High Concurrency
Fanout Queries
Agg 1 Agg 2
Leaf 1 Leaf 2 Leaf 3 Leaf 4
Agg 1 Agg 2
Leaf 1 Leaf 2 Leaf 3 Leaf 4
Single Partition Queries
Distributed Joins
memsql> select * from A join B where A.color = B.color
Distributed Joins
 Queries with joins that do not
match or filter on the shard key
will cause network overhead
 Reshuffle vs Broadcast operators
• Reshuffle: re-shard the data of the
smaller table (or result table) to
evenly match the large table
• Broadcast: send the entire small
table to the other nodes to complete
the join.
How to eliminate the overhead of distributed joins?
 Match on shard key → local join
 Reference tables to the rescue
• Each row replicated to all nodes
• Small data sizes, low # updates
Our star schema
Reference tables
Query tuning: EXPLAIN and PROFILE
 EXPLAIN
• Prints the MemSQL optimizer’s query plan.
• All MemSQL operators for the query are here:
 TableScan, IndexSeek, HashJoin, Repartition, Broadcast, etc.
 PROFILE
• Runs the query based on plan, timing each execution step
• SHOW PROFILE;
 Prints output of query plan execution statistics (memory usage,
execution time, rows scanned, segments skipped)
Query
EXPLAIN SELECT
dim_store.store_address,
SUM(fact_sales.quantity) AS quantity_sold
FROM
fact_sales
INNER JOIN dim_product ON fact_sales.product_id = dim_product.product_id
INNER JOIN dim_time ON fact_sales.time_id = dim_time.time_id
INNER JOIN dim_store ON fact_sales.store_id = dim_store.store_id
WHERE
dim_time.action_year = 2016
AND dim_store.city = ‘Topeka’
AND dim_product.product_type = ‘Aspirin’
GROUP BY
dim_store.store_id,
dim_store.store_address;
ANALYZE and OPTIMIZE
 ANALYZE TABLE
• Calculates table statistics
• Recommended after significant increase/refresh of data
 OPTIMIZE TABLE [FULL | FLUSH]
• FULL: Sorts based on primary key (optimal index scans)
• FLUSH (Columnstore only): Flushes in-memory segment to disk
 Recommended periodically after large loads
Memory & Workload Management
Monitoring your MemSQL
Deployment
Monitoring memory usage
memsql> SHOW STATUS EXTENDED;
memsql> SELECT database_name, table_name, SUM(rows) AS total_rows,
SUM(memory_use)/(1024*1024*1024) AS total_memory_gb,
SUM(memory_use) / SUM(rows) AS bytes_per_row
FROM information_schema.table_statistics
WHERE database_name=“memsql_webinar”
GROUP BY 1, 2 ORDER BY total_memory_gb DESC;
33
Monitoring workload with Management Views
• Set of tables in information_schema database that are
useful for troubleshooting query performance
• Shows resource usage of recent activities across all
nodes in MemSQL cluster
• Activities are categorized into Query, Database, System
• Query: Application or Person querying MemSQL
• Database: Replication Activity, Log Flusher
• System: Garbage Collector, Read and Execute Loops
• Available in Versions 5.8 and greater - must set a global
variable
• read_advanced_counters = ‘ON’
• memsql-ops memsql-update-config --set-global --key read_advanced_counters
--value ‘ON’ --all
Management Views Tables
SHOW tables in information_schema like "MV_%";
Management Views Metrics
These metrics are available for each activity on the cluster:
▪ CPU Time
▪ CPU Wait Time
▪ Memory Bytes
▪ Disk Bytes (Read/Write)
▪ Network Bytes (Send/Receive)
▪ Lock Wait Time
▪ Disk Wait Time
▪ Network Wait Time
▪ Failure Time
What is the most frequent activity type on each
node?
memsql> select node_id, activity_type, count(*)
from mv_activities_extended activities
inner join mv_nodes nodes on nodes.id = activities.node_id
group by 1, 2 order by 2 DESC;
Which partitions are using the most memory?
memsql> select partition_id, sum(memory_bs)
from mv_activities_extended
where partition_id != "NULL"
group by 1 order by 2 limit 5;
What query activities are using the most CPU?
memsql> select activities.cpu_time_ms, activities.activity_name,
LEFT(query.query_text,20)
from mv_activities activities inner join mv_queries query
on query.activity_name= activities.activity_name
order by cpu_time_ms DESC limit 5;
Thank you
memsql.com
Any other questions?
MemSQL Tech Office Hours
1/31 9am–5pm (PST)
https://calendly.com/alec-
powell/30min/01-31-2018
MemSQL 201: Advanced Tips and Tricks Webcast
Ad

More Related Content

What's hot (20)

Hive 3 - a new horizon
Hive 3 - a new horizonHive 3 - a new horizon
Hive 3 - a new horizon
Thejas Nair
 
Oracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web ServicesOracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web Services
Jeff Smith
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTroubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Tanel Poder
 
Understanding MySQL Performance through Benchmarking
Understanding MySQL Performance through BenchmarkingUnderstanding MySQL Performance through Benchmarking
Understanding MySQL Performance through Benchmarking
Laine Campbell
 
Machine Learning on Streaming Data using Kafka, Beam, and TensorFlow (Mikhail...
Machine Learning on Streaming Data using Kafka, Beam, and TensorFlow (Mikhail...Machine Learning on Streaming Data using Kafka, Beam, and TensorFlow (Mikhail...
Machine Learning on Streaming Data using Kafka, Beam, and TensorFlow (Mikhail...
confluent
 
Oracle sql high performance tuning
Oracle sql high performance tuningOracle sql high performance tuning
Oracle sql high performance tuning
Guy Harrison
 
Apache Hbase バルクロードの使い方
Apache Hbase バルクロードの使い方Apache Hbase バルクロードの使い方
Apache Hbase バルクロードの使い方
Takeshi Mikami
 
Christo kutrovsky oracle, memory & linux
Christo kutrovsky   oracle, memory & linuxChristo kutrovsky   oracle, memory & linux
Christo kutrovsky oracle, memory & linux
Kyle Hailey
 
Oracle APEX Interactive Grid Essentials
Oracle APEX Interactive Grid EssentialsOracle APEX Interactive Grid Essentials
Oracle APEX Interactive Grid Essentials
Karen Cannell
 
Achieving 100k Queries per Hour on Hive on Tez
Achieving 100k Queries per Hour on Hive on TezAchieving 100k Queries per Hour on Hive on Tez
Achieving 100k Queries per Hour on Hive on Tez
DataWorks Summit/Hadoop Summit
 
Oracle Data Guard basics and how to create manually 18c plus
Oracle Data Guard basics and how to create manually 18c plusOracle Data Guard basics and how to create manually 18c plus
Oracle Data Guard basics and how to create manually 18c plus
Akira Kusakabe
 
What's New in Apache Hive
What's New in Apache HiveWhat's New in Apache Hive
What's New in Apache Hive
DataWorks Summit
 
Oracle database performance tuning
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuning
Yogiji Creations
 
Oracle Exadata Maintenance tasks 101 - OTN Tour 2015
Oracle Exadata Maintenance tasks 101 - OTN Tour 2015Oracle Exadata Maintenance tasks 101 - OTN Tour 2015
Oracle Exadata Maintenance tasks 101 - OTN Tour 2015
Nelson Calero
 
Reduce SRE Stress: Minimizing Service Downtime with Grafana, InfluxDB and Tel...
Reduce SRE Stress: Minimizing Service Downtime with Grafana, InfluxDB and Tel...Reduce SRE Stress: Minimizing Service Downtime with Grafana, InfluxDB and Tel...
Reduce SRE Stress: Minimizing Service Downtime with Grafana, InfluxDB and Tel...
InfluxData
 
監査ログをもっと身近に!〜統合監査のすすめ〜
監査ログをもっと身近に!〜統合監査のすすめ〜監査ログをもっと身近に!〜統合監査のすすめ〜
監査ログをもっと身近に!〜統合監査のすすめ〜
Michitoshi Yoshida
 
MongoDB vs. Postgres Benchmarks
MongoDB vs. Postgres Benchmarks MongoDB vs. Postgres Benchmarks
MongoDB vs. Postgres Benchmarks
EDB
 
LLAP: long-lived execution in Hive
LLAP: long-lived execution in HiveLLAP: long-lived execution in Hive
LLAP: long-lived execution in Hive
DataWorks Summit
 
Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster
OpenCredo
 
MyRocks Deep Dive
MyRocks Deep DiveMyRocks Deep Dive
MyRocks Deep Dive
Yoshinori Matsunobu
 
Hive 3 - a new horizon
Hive 3 - a new horizonHive 3 - a new horizon
Hive 3 - a new horizon
Thejas Nair
 
Oracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web ServicesOracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web Services
Jeff Smith
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTroubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Tanel Poder
 
Understanding MySQL Performance through Benchmarking
Understanding MySQL Performance through BenchmarkingUnderstanding MySQL Performance through Benchmarking
Understanding MySQL Performance through Benchmarking
Laine Campbell
 
Machine Learning on Streaming Data using Kafka, Beam, and TensorFlow (Mikhail...
Machine Learning on Streaming Data using Kafka, Beam, and TensorFlow (Mikhail...Machine Learning on Streaming Data using Kafka, Beam, and TensorFlow (Mikhail...
Machine Learning on Streaming Data using Kafka, Beam, and TensorFlow (Mikhail...
confluent
 
Oracle sql high performance tuning
Oracle sql high performance tuningOracle sql high performance tuning
Oracle sql high performance tuning
Guy Harrison
 
Apache Hbase バルクロードの使い方
Apache Hbase バルクロードの使い方Apache Hbase バルクロードの使い方
Apache Hbase バルクロードの使い方
Takeshi Mikami
 
Christo kutrovsky oracle, memory & linux
Christo kutrovsky   oracle, memory & linuxChristo kutrovsky   oracle, memory & linux
Christo kutrovsky oracle, memory & linux
Kyle Hailey
 
Oracle APEX Interactive Grid Essentials
Oracle APEX Interactive Grid EssentialsOracle APEX Interactive Grid Essentials
Oracle APEX Interactive Grid Essentials
Karen Cannell
 
Oracle Data Guard basics and how to create manually 18c plus
Oracle Data Guard basics and how to create manually 18c plusOracle Data Guard basics and how to create manually 18c plus
Oracle Data Guard basics and how to create manually 18c plus
Akira Kusakabe
 
Oracle database performance tuning
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuning
Yogiji Creations
 
Oracle Exadata Maintenance tasks 101 - OTN Tour 2015
Oracle Exadata Maintenance tasks 101 - OTN Tour 2015Oracle Exadata Maintenance tasks 101 - OTN Tour 2015
Oracle Exadata Maintenance tasks 101 - OTN Tour 2015
Nelson Calero
 
Reduce SRE Stress: Minimizing Service Downtime with Grafana, InfluxDB and Tel...
Reduce SRE Stress: Minimizing Service Downtime with Grafana, InfluxDB and Tel...Reduce SRE Stress: Minimizing Service Downtime with Grafana, InfluxDB and Tel...
Reduce SRE Stress: Minimizing Service Downtime with Grafana, InfluxDB and Tel...
InfluxData
 
監査ログをもっと身近に!〜統合監査のすすめ〜
監査ログをもっと身近に!〜統合監査のすすめ〜監査ログをもっと身近に!〜統合監査のすすめ〜
監査ログをもっと身近に!〜統合監査のすすめ〜
Michitoshi Yoshida
 
MongoDB vs. Postgres Benchmarks
MongoDB vs. Postgres Benchmarks MongoDB vs. Postgres Benchmarks
MongoDB vs. Postgres Benchmarks
EDB
 
LLAP: long-lived execution in Hive
LLAP: long-lived execution in HiveLLAP: long-lived execution in Hive
LLAP: long-lived execution in Hive
DataWorks Summit
 
Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster
OpenCredo
 

Similar to MemSQL 201: Advanced Tips and Tricks Webcast (20)

Optimizing Your Cloud Applications in RightScale
Optimizing Your Cloud Applications in RightScaleOptimizing Your Cloud Applications in RightScale
Optimizing Your Cloud Applications in RightScale
RightScale
 
SQL Server 2008 Development for Programmers
SQL Server 2008 Development for ProgrammersSQL Server 2008 Development for Programmers
SQL Server 2008 Development for Programmers
Adam Hutson
 
Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019
Antonios Chatzipavlis
 
Getting to Know MySQL Enterprise Monitor
Getting to Know MySQL Enterprise MonitorGetting to Know MySQL Enterprise Monitor
Getting to Know MySQL Enterprise Monitor
Mark Leith
 
Best Practices for Supercharging Cloud Analytics on Amazon Redshift
Best Practices for Supercharging Cloud Analytics on Amazon RedshiftBest Practices for Supercharging Cloud Analytics on Amazon Redshift
Best Practices for Supercharging Cloud Analytics on Amazon Redshift
SnapLogic
 
Sql Server
Sql ServerSql Server
Sql Server
SandyShin
 
SQL Server 2014 Mission Critical Performance - Level 300 Presentation
SQL Server 2014 Mission Critical Performance - Level 300 PresentationSQL Server 2014 Mission Critical Performance - Level 300 Presentation
SQL Server 2014 Mission Critical Performance - Level 300 Presentation
David J Rosenthal
 
Sql Server Performance Tuning
Sql Server Performance TuningSql Server Performance Tuning
Sql Server Performance Tuning
Bala Subra
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_features
AiougVizagChapter
 
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cPresentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Ronald Francisco Vargas Quesada
 
Performance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL DatabasePerformance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL Database
Tung Nguyen Thanh
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architecture
Ajeet Singh
 
Sql server performance tuning
Sql server performance tuningSql server performance tuning
Sql server performance tuning
Jugal Shah
 
Informix partitioning interval_rolling_window_table
Informix partitioning interval_rolling_window_tableInformix partitioning interval_rolling_window_table
Informix partitioning interval_rolling_window_table
Keshav Murthy
 
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL ServerGeek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
IDERA Software
 
Novedades SQL Server 2014
Novedades SQL Server 2014Novedades SQL Server 2014
Novedades SQL Server 2014
netmind
 
Expert summit SQL Server 2016
Expert summit   SQL Server 2016Expert summit   SQL Server 2016
Expert summit SQL Server 2016
Łukasz Grala
 
Performance Tuning
Performance TuningPerformance Tuning
Performance Tuning
Ligaya Turmelle
 
R12 d49656 gc10-apps dba 07
R12 d49656 gc10-apps dba 07R12 d49656 gc10-apps dba 07
R12 d49656 gc10-apps dba 07
zeesniper
 
Mysql For Developers
Mysql For DevelopersMysql For Developers
Mysql For Developers
Carol McDonald
 
Optimizing Your Cloud Applications in RightScale
Optimizing Your Cloud Applications in RightScaleOptimizing Your Cloud Applications in RightScale
Optimizing Your Cloud Applications in RightScale
RightScale
 
SQL Server 2008 Development for Programmers
SQL Server 2008 Development for ProgrammersSQL Server 2008 Development for Programmers
SQL Server 2008 Development for Programmers
Adam Hutson
 
Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019
Antonios Chatzipavlis
 
Getting to Know MySQL Enterprise Monitor
Getting to Know MySQL Enterprise MonitorGetting to Know MySQL Enterprise Monitor
Getting to Know MySQL Enterprise Monitor
Mark Leith
 
Best Practices for Supercharging Cloud Analytics on Amazon Redshift
Best Practices for Supercharging Cloud Analytics on Amazon RedshiftBest Practices for Supercharging Cloud Analytics on Amazon Redshift
Best Practices for Supercharging Cloud Analytics on Amazon Redshift
SnapLogic
 
SQL Server 2014 Mission Critical Performance - Level 300 Presentation
SQL Server 2014 Mission Critical Performance - Level 300 PresentationSQL Server 2014 Mission Critical Performance - Level 300 Presentation
SQL Server 2014 Mission Critical Performance - Level 300 Presentation
David J Rosenthal
 
Sql Server Performance Tuning
Sql Server Performance TuningSql Server Performance Tuning
Sql Server Performance Tuning
Bala Subra
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_features
AiougVizagChapter
 
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cPresentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Ronald Francisco Vargas Quesada
 
Performance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL DatabasePerformance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL Database
Tung Nguyen Thanh
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architecture
Ajeet Singh
 
Sql server performance tuning
Sql server performance tuningSql server performance tuning
Sql server performance tuning
Jugal Shah
 
Informix partitioning interval_rolling_window_table
Informix partitioning interval_rolling_window_tableInformix partitioning interval_rolling_window_table
Informix partitioning interval_rolling_window_table
Keshav Murthy
 
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL ServerGeek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
IDERA Software
 
Novedades SQL Server 2014
Novedades SQL Server 2014Novedades SQL Server 2014
Novedades SQL Server 2014
netmind
 
Expert summit SQL Server 2016
Expert summit   SQL Server 2016Expert summit   SQL Server 2016
Expert summit SQL Server 2016
Łukasz Grala
 
R12 d49656 gc10-apps dba 07
R12 d49656 gc10-apps dba 07R12 d49656 gc10-apps dba 07
R12 d49656 gc10-apps dba 07
zeesniper
 
Ad

More from SingleStore (20)

Five ways database modernization simplifies your data life
Five ways database modernization simplifies your data lifeFive ways database modernization simplifies your data life
Five ways database modernization simplifies your data life
SingleStore
 
How Kafka and Modern Databases Benefit Apps and Analytics
How Kafka and Modern Databases Benefit Apps and AnalyticsHow Kafka and Modern Databases Benefit Apps and Analytics
How Kafka and Modern Databases Benefit Apps and Analytics
SingleStore
 
Architecting Data in the AWS Ecosystem
Architecting Data in the AWS EcosystemArchitecting Data in the AWS Ecosystem
Architecting Data in the AWS Ecosystem
SingleStore
 
Building the Foundation for a Latency-Free Life
Building the Foundation for a Latency-Free LifeBuilding the Foundation for a Latency-Free Life
Building the Foundation for a Latency-Free Life
SingleStore
 
Converging Database Transactions and Analytics
Converging Database Transactions and Analytics Converging Database Transactions and Analytics
Converging Database Transactions and Analytics
SingleStore
 
Building a Machine Learning Recommendation Engine in SQL
Building a Machine Learning Recommendation Engine in SQLBuilding a Machine Learning Recommendation Engine in SQL
Building a Machine Learning Recommendation Engine in SQL
SingleStore
 
Introduction to MemSQL
Introduction to MemSQLIntroduction to MemSQL
Introduction to MemSQL
SingleStore
 
An Engineering Approach to Database Evaluations
An Engineering Approach to Database EvaluationsAn Engineering Approach to Database Evaluations
An Engineering Approach to Database Evaluations
SingleStore
 
Building a Fault Tolerant Distributed Architecture
Building a Fault Tolerant Distributed ArchitectureBuilding a Fault Tolerant Distributed Architecture
Building a Fault Tolerant Distributed Architecture
SingleStore
 
Stream Processing with Pipelines and Stored Procedures
Stream Processing with Pipelines  and Stored ProceduresStream Processing with Pipelines  and Stored Procedures
Stream Processing with Pipelines and Stored Procedures
SingleStore
 
Curriculum Associates Strata NYC 2017
Curriculum Associates Strata NYC 2017Curriculum Associates Strata NYC 2017
Curriculum Associates Strata NYC 2017
SingleStore
 
Image Recognition on Streaming Data
Image Recognition  on Streaming DataImage Recognition  on Streaming Data
Image Recognition on Streaming Data
SingleStore
 
Spark Summit Dublin 2017 - MemSQL - Real-Time Image Recognition
Spark Summit Dublin 2017 - MemSQL - Real-Time Image RecognitionSpark Summit Dublin 2017 - MemSQL - Real-Time Image Recognition
Spark Summit Dublin 2017 - MemSQL - Real-Time Image Recognition
SingleStore
 
The State of the Data Warehouse in 2017 and Beyond
The State of the Data Warehouse in 2017 and BeyondThe State of the Data Warehouse in 2017 and Beyond
The State of the Data Warehouse in 2017 and Beyond
SingleStore
 
How Database Convergence Impacts the Coming Decades of Data Management
How Database Convergence Impacts the Coming Decades of Data ManagementHow Database Convergence Impacts the Coming Decades of Data Management
How Database Convergence Impacts the Coming Decades of Data Management
SingleStore
 
Teaching Databases to Learn in the World of AI
Teaching Databases to Learn in the World of AITeaching Databases to Learn in the World of AI
Teaching Databases to Learn in the World of AI
SingleStore
 
Gartner Catalyst 2017: The Data Warehouse Blueprint for ML, AI, and Hybrid Cloud
Gartner Catalyst 2017: The Data Warehouse Blueprint for ML, AI, and Hybrid CloudGartner Catalyst 2017: The Data Warehouse Blueprint for ML, AI, and Hybrid Cloud
Gartner Catalyst 2017: The Data Warehouse Blueprint for ML, AI, and Hybrid Cloud
SingleStore
 
Gartner Catalyst 2017: Image Recognition on Streaming Data
Gartner Catalyst 2017: Image Recognition on Streaming DataGartner Catalyst 2017: Image Recognition on Streaming Data
Gartner Catalyst 2017: Image Recognition on Streaming Data
SingleStore
 
Spark Summit West 2017: Real-Time Image Recognition with MemSQL and Spark
Spark Summit West 2017: Real-Time Image Recognition with MemSQL and SparkSpark Summit West 2017: Real-Time Image Recognition with MemSQL and Spark
Spark Summit West 2017: Real-Time Image Recognition with MemSQL and Spark
SingleStore
 
Real-Time Analytics at Uber Scale
Real-Time Analytics at Uber ScaleReal-Time Analytics at Uber Scale
Real-Time Analytics at Uber Scale
SingleStore
 
Five ways database modernization simplifies your data life
Five ways database modernization simplifies your data lifeFive ways database modernization simplifies your data life
Five ways database modernization simplifies your data life
SingleStore
 
How Kafka and Modern Databases Benefit Apps and Analytics
How Kafka and Modern Databases Benefit Apps and AnalyticsHow Kafka and Modern Databases Benefit Apps and Analytics
How Kafka and Modern Databases Benefit Apps and Analytics
SingleStore
 
Architecting Data in the AWS Ecosystem
Architecting Data in the AWS EcosystemArchitecting Data in the AWS Ecosystem
Architecting Data in the AWS Ecosystem
SingleStore
 
Building the Foundation for a Latency-Free Life
Building the Foundation for a Latency-Free LifeBuilding the Foundation for a Latency-Free Life
Building the Foundation for a Latency-Free Life
SingleStore
 
Converging Database Transactions and Analytics
Converging Database Transactions and Analytics Converging Database Transactions and Analytics
Converging Database Transactions and Analytics
SingleStore
 
Building a Machine Learning Recommendation Engine in SQL
Building a Machine Learning Recommendation Engine in SQLBuilding a Machine Learning Recommendation Engine in SQL
Building a Machine Learning Recommendation Engine in SQL
SingleStore
 
Introduction to MemSQL
Introduction to MemSQLIntroduction to MemSQL
Introduction to MemSQL
SingleStore
 
An Engineering Approach to Database Evaluations
An Engineering Approach to Database EvaluationsAn Engineering Approach to Database Evaluations
An Engineering Approach to Database Evaluations
SingleStore
 
Building a Fault Tolerant Distributed Architecture
Building a Fault Tolerant Distributed ArchitectureBuilding a Fault Tolerant Distributed Architecture
Building a Fault Tolerant Distributed Architecture
SingleStore
 
Stream Processing with Pipelines and Stored Procedures
Stream Processing with Pipelines  and Stored ProceduresStream Processing with Pipelines  and Stored Procedures
Stream Processing with Pipelines and Stored Procedures
SingleStore
 
Curriculum Associates Strata NYC 2017
Curriculum Associates Strata NYC 2017Curriculum Associates Strata NYC 2017
Curriculum Associates Strata NYC 2017
SingleStore
 
Image Recognition on Streaming Data
Image Recognition  on Streaming DataImage Recognition  on Streaming Data
Image Recognition on Streaming Data
SingleStore
 
Spark Summit Dublin 2017 - MemSQL - Real-Time Image Recognition
Spark Summit Dublin 2017 - MemSQL - Real-Time Image RecognitionSpark Summit Dublin 2017 - MemSQL - Real-Time Image Recognition
Spark Summit Dublin 2017 - MemSQL - Real-Time Image Recognition
SingleStore
 
The State of the Data Warehouse in 2017 and Beyond
The State of the Data Warehouse in 2017 and BeyondThe State of the Data Warehouse in 2017 and Beyond
The State of the Data Warehouse in 2017 and Beyond
SingleStore
 
How Database Convergence Impacts the Coming Decades of Data Management
How Database Convergence Impacts the Coming Decades of Data ManagementHow Database Convergence Impacts the Coming Decades of Data Management
How Database Convergence Impacts the Coming Decades of Data Management
SingleStore
 
Teaching Databases to Learn in the World of AI
Teaching Databases to Learn in the World of AITeaching Databases to Learn in the World of AI
Teaching Databases to Learn in the World of AI
SingleStore
 
Gartner Catalyst 2017: The Data Warehouse Blueprint for ML, AI, and Hybrid Cloud
Gartner Catalyst 2017: The Data Warehouse Blueprint for ML, AI, and Hybrid CloudGartner Catalyst 2017: The Data Warehouse Blueprint for ML, AI, and Hybrid Cloud
Gartner Catalyst 2017: The Data Warehouse Blueprint for ML, AI, and Hybrid Cloud
SingleStore
 
Gartner Catalyst 2017: Image Recognition on Streaming Data
Gartner Catalyst 2017: Image Recognition on Streaming DataGartner Catalyst 2017: Image Recognition on Streaming Data
Gartner Catalyst 2017: Image Recognition on Streaming Data
SingleStore
 
Spark Summit West 2017: Real-Time Image Recognition with MemSQL and Spark
Spark Summit West 2017: Real-Time Image Recognition with MemSQL and SparkSpark Summit West 2017: Real-Time Image Recognition with MemSQL and Spark
Spark Summit West 2017: Real-Time Image Recognition with MemSQL and Spark
SingleStore
 
Real-Time Analytics at Uber Scale
Real-Time Analytics at Uber ScaleReal-Time Analytics at Uber Scale
Real-Time Analytics at Uber Scale
SingleStore
 
Ad

Recently uploaded (20)

Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 

MemSQL 201: Advanced Tips and Tricks Webcast

  • 1. MemSQL 201: Advanced Tips & Tricks Alec Powell, Solutions Engineer, MemSQL January 2018 [email protected]
  • 2. Webinar Agenda Rowstore vs Columnstore Data Ingestion Data Sharding & Query Tuning Memory & Workload Management
  • 3. Rowstore vs Columnstore Making the most of MemSQL’s two storage models
  • 4. Streaming Database Real-Time Pipelines, OLTP, and OLAP Real-time Pipelines High Volume Transactions OLTP Fast, Scalable SQL Analytics OLAP Data Warehouse
  • 5. Streaming Database MemSQL Features Multiple Table Types Memory and Disk Columnstore In-Memory Rowstore Data Warehouse
  • 6. Streaming Database The Rowstore and Columnstore Span Memory to Disk Memory and Disk Columnstore RAM and SSDs In-Memory Rowstore RAM Relational JSON Key Value Geospatial Data Warehouse
  • 7. Streaming Database Both Table Types are Persistent Memory and Disk Columnstore SSDs and HDDs In-Memory Rowstore Persists to SSD for durability Data Warehouse
  • 8. In-Memory Rowstore Flash, SSD or Disk-based Columnstore Operational/transactional workloads Analytical workloads Single-record insert performance Batched load performance Random seek performance Fast aggregations and table scans Updates are frequent Updates are rare Any types of deletes Deletes that remove large # of rows MemSQL allows joining rowstore and columnstore data in a single query When to use Rowstore and Columnstore
  • 10. Example Query SELECT dim_supplier.supplier_address, SUM(fact_supply_order.quantity) AS quantity_sold FROM fact_supply_order INNER JOIN dim_product ON fact_supply_order.product_id = dim_product.product_id INNER JOIN dim_time ON fact_supply_order.time_id = dim_time.time_id INNER JOIN dim_supplier ON fact_supply_order.supplier_id = dim_supplier.supplier_id WHERE dim_time.action_year = 2016 AND dim_supplier.city = ‘Topeka’ AND dim_product.product_type = ‘Aspirin’ GROUP BY dim_supplier.supplier_id, dim_supplier.supplier_address;
  • 11. Columnstore sort key memsql> CREATE TABLE fact_supply_order ( -> product_id INT PRIMARY KEY, -> time_id INT, -> supplier_id INT, -> employee_id INT, -> price DECIMAL(8,2), -> quantity DECIMAL(8,2), -> KEY (time_id, product_id, supplier_id) -> USING CLUSTERED COLUMNSTORE);
  • 13. Data Ingestion Real-time data loading with MemSQL Pipelines
  • 14. Streaming Database Real-Time Pipelines MemSQL Pipelines Simplifies Real-Time Data Pipelines ColumnstoreRowstore Data Warehouse
  • 15. Streaming Database Stream into the Rowstore or Columnstore Real-Time Pipelines streams directly into the Rowstore or the Columnstore ColumnstoreRowstore Data Warehouse
  • 16. Pipelines enables partition-level Parallelism Leaf 1 Leaf 2 Leaf 3 Leaf 4
  • 17. Loading our table using S3 Pipelines memsql> CREATE PIPELINE orders_pipeline AS -> LOAD DATA S3 ”deloy.test/alec/orders-history” -> CREDENTIALS ‘{redacted}’ -> SKIP ALL ERRORS -> INTO TABLE fact_supply_order; Query OK, (0.89 sec) memsql> START PIPELINE orders_pipeline; Query OK, (0.01 sec) memsql> SELECT count(*) from fact_supply_order;
  • 18. Sharding & Query Tuning Understanding the distributed system
  • 19. MemSQL has aggregator and leaf nodes LeafLeafLeafLeaf Agg Aggregator Master Aggregator
  • 20. Database clients connect to aggregators AggregatorAggregator LeafLeafLeafLeaf PARTITIONS PARTITIONS PARTITIONS PARTITIONS Database Client
  • 21. Leaf nodes store and process data in partitions AggregatorAggregator LeafLeafLeafLeaf PARTITIONS PARTITIONS PARTITIONS PARTITIONS
  • 22. Designing a Schema: Shard Keys  Every distributed table has 1 shard key • Non-unique key OK (eg. SHARD KEY (id, click_id, user_id))  Determines the partition to which a row belongs  If not specified, PRIMARY KEY is used.  If no primary key, it will be empty (i.e. randomly distribute).  Equality on all shard key columns → single partition query  Most queries are not like this → query all partitions HASH(“12345”) % NUM_PARTITIONS = 17
  • 23. Great for Analytical Queries:  Large aggregations  Parallel processing Critical for Transactional Queries:  Selecting Single Rows  High Concurrency Fanout Queries Agg 1 Agg 2 Leaf 1 Leaf 2 Leaf 3 Leaf 4 Agg 1 Agg 2 Leaf 1 Leaf 2 Leaf 3 Leaf 4 Single Partition Queries
  • 24. Distributed Joins memsql> select * from A join B where A.color = B.color
  • 25. Distributed Joins  Queries with joins that do not match or filter on the shard key will cause network overhead  Reshuffle vs Broadcast operators • Reshuffle: re-shard the data of the smaller table (or result table) to evenly match the large table • Broadcast: send the entire small table to the other nodes to complete the join.
  • 26. How to eliminate the overhead of distributed joins?  Match on shard key → local join  Reference tables to the rescue • Each row replicated to all nodes • Small data sizes, low # updates
  • 28. Query tuning: EXPLAIN and PROFILE  EXPLAIN • Prints the MemSQL optimizer’s query plan. • All MemSQL operators for the query are here:  TableScan, IndexSeek, HashJoin, Repartition, Broadcast, etc.  PROFILE • Runs the query based on plan, timing each execution step • SHOW PROFILE;  Prints output of query plan execution statistics (memory usage, execution time, rows scanned, segments skipped)
  • 29. Query EXPLAIN SELECT dim_store.store_address, SUM(fact_sales.quantity) AS quantity_sold FROM fact_sales INNER JOIN dim_product ON fact_sales.product_id = dim_product.product_id INNER JOIN dim_time ON fact_sales.time_id = dim_time.time_id INNER JOIN dim_store ON fact_sales.store_id = dim_store.store_id WHERE dim_time.action_year = 2016 AND dim_store.city = ‘Topeka’ AND dim_product.product_type = ‘Aspirin’ GROUP BY dim_store.store_id, dim_store.store_address;
  • 30. ANALYZE and OPTIMIZE  ANALYZE TABLE • Calculates table statistics • Recommended after significant increase/refresh of data  OPTIMIZE TABLE [FULL | FLUSH] • FULL: Sorts based on primary key (optimal index scans) • FLUSH (Columnstore only): Flushes in-memory segment to disk  Recommended periodically after large loads
  • 31. Memory & Workload Management Monitoring your MemSQL Deployment
  • 32. Monitoring memory usage memsql> SHOW STATUS EXTENDED; memsql> SELECT database_name, table_name, SUM(rows) AS total_rows, SUM(memory_use)/(1024*1024*1024) AS total_memory_gb, SUM(memory_use) / SUM(rows) AS bytes_per_row FROM information_schema.table_statistics WHERE database_name=“memsql_webinar” GROUP BY 1, 2 ORDER BY total_memory_gb DESC;
  • 33. 33 Monitoring workload with Management Views • Set of tables in information_schema database that are useful for troubleshooting query performance • Shows resource usage of recent activities across all nodes in MemSQL cluster • Activities are categorized into Query, Database, System • Query: Application or Person querying MemSQL • Database: Replication Activity, Log Flusher • System: Garbage Collector, Read and Execute Loops • Available in Versions 5.8 and greater - must set a global variable • read_advanced_counters = ‘ON’ • memsql-ops memsql-update-config --set-global --key read_advanced_counters --value ‘ON’ --all
  • 34. Management Views Tables SHOW tables in information_schema like "MV_%";
  • 35. Management Views Metrics These metrics are available for each activity on the cluster: ▪ CPU Time ▪ CPU Wait Time ▪ Memory Bytes ▪ Disk Bytes (Read/Write) ▪ Network Bytes (Send/Receive) ▪ Lock Wait Time ▪ Disk Wait Time ▪ Network Wait Time ▪ Failure Time
  • 36. What is the most frequent activity type on each node? memsql> select node_id, activity_type, count(*) from mv_activities_extended activities inner join mv_nodes nodes on nodes.id = activities.node_id group by 1, 2 order by 2 DESC;
  • 37. Which partitions are using the most memory? memsql> select partition_id, sum(memory_bs) from mv_activities_extended where partition_id != "NULL" group by 1 order by 2 limit 5;
  • 38. What query activities are using the most CPU? memsql> select activities.cpu_time_ms, activities.activity_name, LEFT(query.query_text,20) from mv_activities activities inner join mv_queries query on query.activity_name= activities.activity_name order by cpu_time_ms DESC limit 5;
  • 40. Any other questions? MemSQL Tech Office Hours 1/31 9am–5pm (PST) https://calendly.com/alec- powell/30min/01-31-2018