Query Processing on Smart SSDs Opportunities and Challenges - - PowerPoint PPT Presentation

query processing on smart ssds
SMART_READER_LITE
LIVE PREVIEW

Query Processing on Smart SSDs Opportunities and Challenges - - PowerPoint PPT Presentation

Query Processing on Smart SSDs Opportunities and Challenges Jaeyoung Do 1 , Yang Seok Ki 2 , Jignesh M. Patel 1 , Chanik Park 2 , Kwanghyun Park 1 , David J. DeWitt 3 1 University of Wisconsin Madison Contact: 2 Samsung Semiconductor Inc.


slide-1
SLIDE 1

Query Processing

  • n Smart SSDs

Opportunities and Challenges

Jaeyoung Do1, Yang Seok Ki2, Jignesh M. Patel1, Chanik Park2, Kwanghyun Park1, David J. DeWitt3

1 University of Wisconsin – Madison 2 Samsung Semiconductor Inc. 3 Microsoft Jim Gray Systems Lab

1

Contact: jignesh@cs.wisc.edu The opinions expressed here are those of the authors, and not necessarily of the organizations to which the authors belong.

slide-2
SLIDE 2

Motivation

2

CP U DRAM

cache s

Magnetic Hard Disk Drives

CPU

NVRAM (e.g. SSDs) Bus NVRAM (e.g. SSDs) DRAM

slide-3
SLIDE 3

Inside a Modern SSD

  • Embedded processors (low power)

CPU

  • General-purpose memory

Memory

  • High I/O bandwidth inside the flash chips

I/O

3

SSD Controller Embedded Processor DRAM Controller Flash Memory Controller Flash Memory Controller Flash Memory Controller SRAM Host Interface Controller DRAM F F F F F F

Flash ¡SSD ¡Device ¡

slide-4
SLIDE 4

4

1 10 100 2007 2008 2009 2010 2011 2012 2013 2014 2015

Bandwidth Relative to the I/O Interface Speed

Year

I/O Interface Inside the SSD

slide-5
SLIDE 5

5

  • Push code through the “straw,” thereby drinking

smaller amounts through the straw Philosophically similar to what Netezza and Exadata do today, but using “commodity” resources inside the SSD

The Opportunity

  • Higher performance
  • Lower energy consumption (Joules/query)
  • Lower cost when building balanced systems
  • Simpler appliances

Potential Advantages

  • Programming tools for the SSD are primitive
  • Not enough “spare” processing power
  • Some hardware architectural limitations
  • Deeper DBMS implications: query optimization,

buffer pool caching, updates, transaction mgmt., etc.

Current Challenges

slide-6
SLIDE 6

6

Host

I/O Interface I/O Interface

Aggregate Scan

Host

I/O Interface I/O Interface

Aggregate Pre- Aggregate Scan

slide-7
SLIDE 7

Implementation Details

  • New Smart SSD APIs to run

database operations inside the SSD

  • Open(), Get(), Close(), SendToHost()

Samsung Smart SSD

  • Modified the query processor to

hard-code selected Smart SSD plans

  • Implement Smart SSD executors

SQL Server

7

slide-8
SLIDE 8

Communication Flow – e.g. Scan

8

Scanning ¡… ¡ ¡ ¡ ¡Get(): ¡Are ¡there ¡results? ¡ NO Get(): ¡Are ¡there ¡results? YES, ¡results 5μsec ¡ Get(): ¡Are ¡there ¡results FINISHED Scan ¡is ¡done ¡ ¡ ¡ ¡ ¡ ¡ ¡Open(): ¡Metadata OK

SQL ¡Server Smart ¡SSD ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡Close() OK

slide-9
SLIDE 9

9

Data page A tuple A value of a column in a tuple

Embedded Processor DRAM Controller

Flash Memory Controller Flash Memory Controller Flash Memory Controller

SRAM Host Interface Controller DRAM F F F F F F

Inside ¡the ¡Flash ¡SSD ¡ Data storage

If qualified Copy projected columns’ values to output buffer

int char int vchar

Data Flow inside the SSD (NSM format)

slide-10
SLIDE 10

Storage Formats

  • NSM layout
  • PAX layout

10

Data Page Tuple

int char date int char date

Column

slide-11
SLIDE 11

11

Embedded Processor DRAM Controller

Flash Memory Controller Flash Memory Controller Flash Memory Controller

SRAM Host Interface Controller DRAM F F F F F F

Inside ¡the ¡Flash ¡SSD ¡ Data storage

Data page A column A value of a column in a tuple

If qualified 32 Bytes LDM_CMP function Copy projected columns’ values to output buffer

int char int int int char char char

Data Flow inside the SSD with the PAX layout

slide-12
SLIDE 12

System Configuration

12

SQL server (Host machine) Flash SSD HDD 64-bit Windows 7 32GB DRAM (24GB dedicated to the DBMS) 2.66 GHz Dual Quad Core Intel Xeon5430 32KB L1 cache, 6MB L2 cache Two 7.5 RPM SATA HDDs one for the OS and one for the Log LSI four-port SATA/SAS 6Gbps HBA (host bus adapter) Samsung 400GB SAS SSD Two ARM Cores 16KB SRAM for each core 256KB DRAM for each core 1MB DRAM output buffer HP 146GB 10K RPM SAS HDD

slide-13
SLIDE 13

Upper Bound on Expected Performance Gains

500 1000 1500 SAS HDD SAS SSD Smart SSD (Internal) 80 550 1560 Maximum Sequential Read (MB/s)

13

20X Speed of a Simple Sequential Scan Program

slide-14
SLIDE 14

Experimental Setup: Synthetic Data

14

Table # Columns Table Size (GB) # tuples (millions) # tuples/ page Synthetic 4 4 10 400 323 Synthetic16 16 30 400 109 Synthetic64 64 110 400 29

Each table has a number of integer-typed columns

slide-15
SLIDE 15

Experimental Setup: TPC-H

15

Lineitem ¡( ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡L_ORDERKEY ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡bigint, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡L_PARTKEY ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡int, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡L_SUPPKEY ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡int, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡L_LINENUMBER ¡ ¡ ¡ ¡int, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡L_QUANTITY ¡ ¡ ¡ ¡bigint, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡L_EXTENDEDPRICE ¡ ¡ ¡bigint, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡L_DISCOUNT ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡bigint, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡L_TAX ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡bigint, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡L_SHIPDATE ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡int, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡L_COMMITDATE ¡ ¡ ¡ ¡ ¡ ¡int, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡L_RECEIPTDATE ¡ ¡ ¡ ¡ ¡ ¡ ¡int, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡L_RETURNFLAG ¡ ¡ ¡ ¡ ¡ ¡ ¡char(1), ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡L_LINESTATUS ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡char(1), ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡L_SHIPINSTRUCT ¡ ¡ ¡ ¡char(25), ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡L_SHIPMODE ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡char(10), ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡L_COMMENT ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡char(47), ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ) ¡

Modified TPC-H Lineitem Table, 600M tuples, 94GB

slide-16
SLIDE 16

10% Selection Query

16 1 10 100 1000 10 100 1000

Total Energy (KJ), log scale Elapsed Time (seconds), log scale

15.5X 16.0X

SELECT COLUMN_2 FROM Synthetic64 WHERE COLUMN_1 < [VALUE] Smart SSD (PAX) Smart SSD (NSM) SAS SSD SAS HDD

slide-17
SLIDE 17

10% Selection Query

17 10 100 10 100

Total Energy (KJ), log scale Elapsed Time (seconds), log scale

2.4X 2.3X

SELECT COLUMN_2 FROM Synthetic64 WHERE COLUMN_1 < [VALUE] Smart SSD (PAX) Smart SSD (NSM) SAS SSD SAS HDD

slide-18
SLIDE 18

10% Selection Query

18 5 10 15 500 1000 1500

I/O Subsystem Energy (KJ) Elapsed Time (seconds)

SELECT COLUMN_2 FROM Synthetic64 WHERE COLUMN_1 < [VALUE]

23.0X 16.0X

Smart SSD (PAX) Smart SSD (NSM) SAS SSD SAS HDD

slide-19
SLIDE 19

10% Selection Query

19 0.5 1 50 100 150 200 250

I/O Subsystem Energy (KJ) Elapsed Time (seconds)

SELECT COLUMN_2 FROM Synthetic64 WHERE COLUMN_1 < [VALUE] Smart SSD (PAX) Smart SSD (NSM) SAS SSD SAS HDD

1.8X 2.3X

slide-20
SLIDE 20

Effect of the # of Tuples on a Page

20 50 100 150 200 Synthetic4 Synthetic16 Synthetic64

Time (seconds)

Target Table

SAS SSD Smart SSD(PAX)

SELECT COLUMN_2, FROM [Synthetic_table] WHERE COLUMN_1 < [VALUE]

Synthetic4: (323 tuples/page) Synthetic16: (109 tuples/page) Synthetic64: (29 tuples/page)

Smart SSD outperforms the regular SSD Smart SSD underperforms compared to the regular SSD

slide-21
SLIDE 21

10% Aggregation Query

21 1 10 100 1000 10 100 1000

Total Energy (KJ), log scale Elapsed Time (seconds), log scale

16.4X 16.9X

SELECT AVG(COLUMN_2) FROM Synthetic64 WHERE COLUMN_1 < [VALUE] Smart SSD (PAX) Smart SSD (NSM) SAS SSD SAS HDD

slide-22
SLIDE 22

10% Aggregation Query

22 10 100 10 100

Total Energy (KJ), log scale Elapsed Time (seconds), log scale

2.6X 2.4X

SELECT AVG(COLUMN_2) FROM Synthetic64 WHERE COLUMN_1 < [VALUE] Smart SSD (PAX) Smart SSD (NSM) SAS SSD SAS HDD

slide-23
SLIDE 23

10% Aggregation Query

23 5 10 15 500 1000 1500

I/O Subsystem Energy (KJ) Elapsed Time (seconds)

SELECT AVG(COLUMN_2) FROM Synthetic64 WHERE COLUMN_1 < [VALUE]

20.9X 16.9X

Smart SSD (PAX) Smart SSD (NSM) SAS SSD SAS HDD

slide-24
SLIDE 24

10% Aggregation Query

24 0.5 1 50 100 150 200 250

I/O Subsystem Energy (KJ) Elapsed Time (seconds)

SELECT AVG(COLUMN_2) FROM Synthetic64 WHERE COLUMN_1 < [VALUE] Smart SSD (PAX) Smart SSD (NSM) SAS SSD SAS HDD

1.8X 2.4X

slide-25
SLIDE 25

TPC-H Query 6

25 10 100 10 100 1000

Total Energy (KJ), log scale Elapsed Time (seconds), log scale

SELECT ¡ ¡ ¡ ¡ ¡SUM(EXTENDEDPRICE*DISCOUNT) ¡ FROM ¡ ¡ ¡ ¡ ¡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¡ ¡ ¡SHIPDATE>=1994-­‑01-­‑01, ¡SHIPDATE<1995-­‑01-­‑01, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡DISCOUNT ¡> ¡0.05, ¡ ¡DISCOUNT ¡< ¡0.07, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡QUANTITY ¡< ¡24 ¡ Smart SSD (PAX) Smart SSD (NSM) SAS SSD SAS HDD

slide-28
SLIDE 28

TPC-H Query 6

28 0.5 1 1.5 2 50 100 150 200

I/O Subsystem Energy (KJ) Elapsed Time (seconds)

SELECT ¡ ¡ ¡ ¡ ¡SUM(EXTENDEDPRICE*DISCOUNT) ¡ FROM ¡ ¡ ¡ ¡ ¡ ¡ ¡LINEITEM ¡ ¡ WHERE ¡ ¡ ¡ ¡ ¡SHIPDATE>=1994-­‑01-­‑01, ¡SHIPDATE<1995-­‑01-­‑01, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡DISCOUNT ¡> ¡0.05, ¡ ¡DISCOUNT ¡< ¡0.07, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡QUANTITY ¡< ¡24 ¡ Smart SSD (PAX) Smart SSD (NSM) SAS SSD SAS HDD

1.4X 1.7X

slide-29
SLIDE 29

Conclusions and Directions for Future Work

  • Computing and storage boundaries are no longer as

rigid as they have been in the past

  • “Commodity” computing in storage devices is here
  • Communication buses evolve slower than other parts
  • f the system

Big Picture

  • Push code to data rather than pull data to the (main)

processor

  • Make general-purpose processing a commodity pre-

built “into” the device

Opportunity

  • Need better programming tools
  • Various SSD hardware architectural changes needed

(but appear to be feasible, cheaply)

  • DBMS internals also need significant changes

Challenges

29

slide-30
SLIDE 30

Co-dependency

Hardware

  • More processing

behind the bus

  • Commodity

processing

  • Better programming

tools

  • Long-term roadmap

Software

  • Caching

implications

  • Query optimization
  • Consistency
  • Concurrency
  • Storage
  • ptimization

30

  • Significant $ and time investment needed
  • n both sides.
  • Who is willing to take the long-term view

and invest?