More Related Content
Similar to Informix warehouse accelerator update (20)
More from IBM Sverige (20)
Informix warehouse accelerator update
- 1. © 2014 IBM Corporation
Sandor Szabo IBM Informix Development Lab â IBM Software Group
May , 2014
BLU Acceleration for SQL / NoSQL
databases
Extreme Speed with In-Memory Analytics
- 2. © 2014 IBM Corporation
Informix 12.1
22
Agenda: Informix Warehouse Accelerator (IWA)
âą Data Warehouse Trends
âą Informix Warehouse Accelerator (IWA)
âą Technology Overview
âą How it Works
âą Positioning and Competition
âą Customers and Partners
âą Reference Architecture
âą 12.10 Features & Roadmap
âą Q&A
- 3. © 2014 IBM Corporation
Informix 12.1
33
TRENDS
Database and Data Warehousing Industry
- 4. © 2014 IBM Corporation
Informix 12.1
44
Data Warehousing Workload & Optimizations
ï§ Data Warehousing/OLAP workload
are inherently more complex than
OLTP transactions and reasons are
well-documented
ï§ Ways to overcome that include:
â Building Indexes
â Partitioning of Data
â Building Cubes (MOLAP / ROLAP / HOLAP)
â Query Tuning
â Appliances that add a new layer of Hardware
to perform I/O for DBMS
ï§ Mixed-Workload always a challenge
ï§ DBMS needs to be built to handle
such a workload
- 5. © 2014 IBM Corporation
Informix 12.1
55
Third Generation of Database Technology
According to IDCâs Article (Carl Olofson) â Feb. 2010
ï§ 1st Generation:
âVendor proprietary databases of IMS, IDMS, Datacom
ï§ 2nd Generation:
âRDBMS for Open Systems
âDependent on disk layout, limitations in scalability and disk I/O
ï§ 3rd Generation: IDC Predicts that within 5 years:
âMost data warehouses will be stored in a columnar fashion
âMost OLTP database will either be augmented by an in-memory database
(IMDB) or reside entirely in memory
âMost large-scale database servers will achieve horizontal scalability through
clustering
- 6. © 2014 IBM Corporation
Informix 12.1
66
In-Memory DB: Why Now?
ï§ 64-bit processors can address up to16 exabytes of data
ï§ DRAM prices drop by 30% every 18 months
ï§ 1 Gb of NAND flash memory average price is less than US$0,50
ï§ Commodity blades provide 1 terabyte of DRAM
ï§ Multicore CPUs enable parallel processing of in-memory data
ï§ In-memory-enabling software is amply available and proven
- 7. © 2014 IBM Corporation
Informix 12.1
77
âBy 2012, 70% of Global 1000 organizations will load detailed data into
memory as the primary method to optimize BI application performance.â
- Gartner
Conventional
Databases
Disk Read
5 milliseconds
In-Memory Databases
Disk Read
5 nanoseconds
The idea: Store & Process Data in Memory instead on Disk
to analyze data magnitudes Faster Than with traditional systems
- 8. © 2014 IBM Corporation
Informix 12.1
88
TECHNOLOGY OVERVIEW
IBM Informix Warehouse Accelerator (IWA)
- 9. © 2014 IBM Corporation
Informix 12.1
99
Introducing IBM Informix Warehouse Accelerator (IWA)
Results
Analytic
query
Linux on
Intel / AMD 64-bit
TCP/IP
Query
Optimizer
In-Memory
Compressed
Columnar
Database Partition
Bulk Loader
Query
Processor
Yes
Analytic
query
Results
Accelerate
Query?
Most Unix/Linux
64-bit platforms
In-Disk
[Compressed]
Relational / Row-based
Database
Informix database server
Informix Warehouse
Accelerator
No
POWERFUL HYBRID DATABASE PLATFORMPOWERFUL HYBRID DATABASE PLATFORM
Extreme Performance Transactions Extreme Performance Analytics
- 10. © 2014 IBM Corporation
Informix 12.1
1010
Unique combination of technologies for Speed-of-Thought Analysis
In-Memory Data storage &
Query Processing
Multi-Core Parallelism and Vector
Optimized Algorithm (No Locking)
on Intel 64-bit SIMD technology
Massive Parallel Processing of
Data Load/Refresh & Query
Fast Storage Backup in Disk for
recovery purposes
IWA combines Breakthrough IBM Research & Development Lab Innovations
Row (Informix) &
Column (IWA) data storage
Deep Data Compression
Fits TB of raw data storage
Predicate evaluation done directly
on Compressed data
Intelligent Frequency Partitioning
Full, Partial and Incremental
Refresh (Insert Only on Delta)
IWA
IWA
Informix
IWAInformix
IWA
IWA
File System
copy
Memory
- 11. © 2014 IBM Corporation
Informix 12.1
1111
IWA Benefits
ï§ Extreme performance for Analytics: 100x+ faster response times for complex BI queries
ï§ Leverages existing Informix database, builds on top, to provide instant performance boost
ï§ Uses low cost commodity HW: Linux on Intel/AMD 64-bit
ï§ Handles Terabytes of data in-memory, thanks to compressed storage and query technology
ï§ Works âbehind the scenesâ in Informix, transparent to client applications
ï§ Very simple and flexible installation, configuration and administration
ï§ Informix + IWA is a hybrid database platform which provides the best technology and
performance for both OLTP and OLAP workloads and support of Big Data solutions
ï§ No need to keep doing all this in order to get high performance OLAP queries:
â Indexes
â Aggregates / summary tables
â Materialized query tables/views
â Cubes
â Decide on best data partition strategies
â Keep different database systems for each type
of workload: OLTP vs OLAP
â Migrate data to another OLAP database
â Change your database schema
â Change your analytic applications
â Tune I/O, memory and CPU for OLAP
â Update Statistics
â Tune Queries with Optimizer Directives
- 12. © 2014 IBM Corporation
Informix 12.1
1212
You can use IWAâs In-Memory Analytics to Speed Up queries onâŠ
- 13. © 2014 IBM Corporation
Informix 12.1
1313
HOW IT WORKS
IBM Informix Warehouse Accelerator (IWA)
- 14. © 2014 IBM Corporation
Informix 12.1
1414
IWA Overview and Seamless Integration with Informix/IDS
ï§ Before IWAâŠ
ï§ Informix
â Receives analytic query from client
â Spends some time doing intensive I/O
â Returns results back to the client
Informix 12.1
Results
SQL
- 15. © 2014 IBM Corporation
Informix 12.1
1515
IWA Overview and Seamless Integration with Informix/IDS
ï§ Setting up IWAâŠ
ï§ Informix
â Determine the database subset used in
analytic queries to accelerate (data mart)
âą Manually or through Workload Analysis
â Deploy an IWA data mart based on DB subset
âą Stream Load the data from Informix into IWA
â Informix Optimizer is aware of IWA datamart
Informix 12.1
ï§ The Accelerator
â Install and configure IWA on Linux x86_86
â Connect with Informix using custom protocol
â IWA compresses and stores a copy of the
Informix DB set into data marts in-memory
â IWA data mart is fully loaded, valid and
ready for Informix server to use as needed
Linux on
Intel/AMD 64-bit
Bulk Loader Compressed
Database
Partition
TCP/IP
Compression
In-Memory Columnar Storage
Frequency Partitioning
Parallelism
Predicate evaluation on compressed data
Multi-core and Vector optimized algorithms
SIMD
Compression
In-Memory Columnar Storage
Frequency Partitioning
Parallelism
Predicate evaluation on compressed data
Multi-core and Vector optimized algorithms
SIMD
Query Router
Query Processor
- 16. © 2014 IBM Corporation
Informix 12.1
1616
IWA Overview and Seamless Integration with Informix/IDS
ï§ Using IWA: Process is transparent to Informix client
Results
SQL
16 Introduction to IBM Informix Warehouse Accelerator
ï§ Informix
â Receives analytic query from client
â If query uses data matching an IWA datamart
and can be accelerated, route/offload it to IWA
â Returns results back to the client
Informix 12.1
ï§ The Accelerator
â Processes the routed SQL query extremely
fast and returns answer back to Informix
Linux on
Intel/AMD 64-bit
Bulk Loader Compressed
Database
Partition
TCP/IP
Compression
In-Memory Columnar Storage
Frequency Partitioning
Parallelism
Predicate evaluation on compressed data
Multi-core and Vector optimized algorithms
SIMD
Compression
In-Memory Columnar Storage
Frequency Partitioning
Parallelism
Predicate evaluation on compressed data
Multi-core and Vector optimized algorithms
SIMD
Query Router
Query Processor
SQL
Results
- 17. © 2014 IBM Corporation
Informix 12.1
1717
IWA Overview and Seamless Integration with Informix/IDS
ï§ Using IWA: Process is transparent to Informix client
Results
SQL
17 Introduction to IBM Informix Warehouse Accelerator
ï§ Informix
â Receives analytic query from client
â If query uses data matching an IWA datamart
and can be accelerated, route/offload it to IWA
â Returns results back to the client
â If query is not based on an IWA datamart or
cannot be accelerated, Informix will resolve it
Informix 12.1
ï§ The Accelerator
â Processes the routed SQL query extremely
fast and returns answer back to Informix
Linux on
Intel/AMD 64-bit
Bulk Loader Compressed
Database
Partition
TCP/IP
Compression
In-Memory Columnar Storage
Frequency Partitioning
Parallelism
Predicate evaluation on compressed data
Multi-core and Vector optimized algorithms
SIMD
Compression
In-Memory Columnar Storage
Frequency Partitioning
Parallelism
Predicate evaluation on compressed data
Multi-core and Vector optimized algorithms
SIMD
Query Router
Query Processor
- 18. © 2014 IBM Corporation
Informix 12.1
1818
CUSTOMERS AND PARTNERS
Informix Warehouse Accelerator (IWA)
- 19. © 2014 IBM Corporation
Informix 12.1
1919
FederaciĂł FarmacĂšutica SCCL
50K IWA query requests a day
464 Million rows in biggest fact table
34x faster Global Sales statistics:
From 1hr down to 1min 45sec
2x faster Invoicing systems
30 users, 83 processes using IWA
Huge savings in Data Warehouse space in disk:
No need for Staging Tables: Size went from 4.5TB to 500GB
Informix Storage Optimization Feature (Deep Compression): Size from 500GB to 140GB
âPrevious DWH needs a lot of staging tables due to performance issues. With IWA we've
dropped all Staging requirements and converted our old 4.5 Terabytes DWH to 500GB
on disk. With IWA, our invoicing system has dropped dramatically the time required
from 24H to just 12H.â
Santi Pla, IT Director, FedeFarma
âPrevious DWH needs a lot of staging tables due to performance issues. With IWA we've
dropped all Staging requirements and converted our old 4.5 Terabytes DWH to 500GB
on disk. With IWA, our invoicing system has dropped dramatically the time required
from 24H to just 12H.â
Santi Pla, IT Director, FedeFarma
- 20. © 2014 IBM Corporation
Informix 12.1
2020
Corporate Name: LABCO S.A.
Brand Name: Labco
Life Sciences, Medical and Laboratory Services
IWA Utilization Country: Belgium, France,
Portugal, Spain, Switzerland
IBM Business Partner: Deister S.A.
Solution components:
Hardware: IWA runs on 8 cores IBM X Series Intel Xeon
Software: IBM Informix Advanced Enterprise Edition v12
IBM Informix Technologies used:
Informix Warehouse Accelerator (IWA)
Storage Optimization Feature (Deep Compression)
- 21. © 2014 IBM Corporation
Informix 12.1
2121
LABCO
20K IWA analytic query requests a day
2 big data marts, with these fact tables:
1150 Million rows fact table one
484 Million rows fact table the other
783GB database (w/ storage optimization)
48x faster response of heavy dashboards:
From 24hr down to 30min
Fast deep analysis of laboratory data: Average analysis time: 1min 45sec
15 users, 20 processes using IWA; DWH is becoming source of info for new users
âWithout IWA, this project could not been completed successfully. Delivering accurate
information of the status of a pan European group to the decision makers staff in minutes
was impossible previously. Now with IWA, a lot of new information is available and
could be analyzed at the moment it's required.â
Vicente Salvador, Deister S.A.
âWithout IWA, this project could not been completed successfully. Delivering accurate
information of the status of a pan European group to the decision makers staff in minutes
was impossible previously. Now with IWA, a lot of new information is available and
could be analyzed at the moment it's required.â
Vicente Salvador, Deister S.A.
- 22. © 2014 IBM Corporation
Informix 12.1
2222
Europeâs Largest Power company tackles the Smart Meter Big Data
challenge with Informix TimeSeries + In-Memory Accelerator (IWA)
ï§ E.ON Metering (EMTG) is the centre of excellence for the development and
commercialization of smart energy solutions and technologies and part of Europeâs largest
Power and Gas company E.ON
ï§ EMTG operates a sophisticated Smart Meter data infrastructure based on IBM Informix
TimeSeries technology in combination with Informix In-Memory Warehouse Accelerator
ï§ IBM Information Management products currently used:
â Informix 11.70 Ultimate Warehouse Edition
â Cognos Business Intelligence 10
- 23. © 2014 IBM Corporation
Informix 12.1
2323
ROADMAP & NEW FEATURES
Informix Warehouse Accelerator (IWA)
- 24. © 2014 IBM Corporation
Informix 12.1
2424
Informix 11.70.FC2
(Mar 2011)
ï§ IWA 1st Release on IUWE
ï§ On SMP
Informix 11.70.FC3
(Jun 2011)
ï§ Workload Analysis Tool
ï§ Support of more Locales
ï§ Support of Data Currency
Informix 11.70.FC4
(Oct 2011)
ï§ IGWE (Growth ed. IWA)
ï§ IWA cluster on Blade Server
ï§ Non-disruptive Mart Refresh
ï§ New AQT monitoring options
ï§ New SQL syntax/functions
Roadmap of IWA-Specific Features
Informix 11.70.FC5
(May 2012)
ï§ Use w/IDS Secondary Servers
ï§ New use_dwa options
ï§ Multiple DISTINCTâs in IDS+IWA
ï§ Additional SQL functions/syntax
ï§ Support Solaris Intel 64 on IDS
ï§ Partition-level Fact tables refresh
ï§ Support col[x,y] substr notation
Informix 11.70.FC6
(Oct 2012)
ï§ Partition-level refresh on
Dimension tables
Informix 11.70.FC7
(Dec 2012)
ï§ Enhanced query processing on
sessions with multiple cursors
open
Informix 12.10.FC3
(Mar 2014)
ï§ IWA support of synonyms and views,
allows using new and multiple
sources of data in a single data mart
and query:
ï§ Data from local/remote tables
ï§ NoSQL data (mapped views)
ï§ Enables Self-Joins (via views)
ï§ New function QUARTER in IDS+IWA
ï§ Extended LIMIT syntax in IDS+IWA
ï§ IWA accelerates NoSQL data (views)
ï§ New use_dwa option (uniquecheck)
20112011 20122012 20132013 20142014
ï§ Informix 12.10.FC1
(Mar 2013)
ï§ Cognos BI [+SPSS] in Advanced ed.
ï§ Automatic partition-level refresh
ï§ Continuous refresh: Trickle Feed,
enabling real-time / right-time
analytics
ï§ Standard OLAP SQL in IDS+IWA
ï§ Support of UNION [ALL] queries
ï§ CTE: SELECTâŠFROM (SELECTâŠ)
ï§ Support of INSERT INTOâŠSELECT
ï§ Additional SQL and data types
ï§ Admin w/OAT & built-in ifx_ functions
ï§ WAREHOUSE security privilege
Informix 12.10.FC2
(Sep 2013)
ï§ Support of data from External Tables
ï§ TimeSeries data (VTI) support: Real-
time analytics & Big Data on sensor
data
ï§ IDS (not IWA): Hybrid SQL + NoSQL
(non-structured data: JSON/BSON)
- 25. © 2014 IBM Corporation
Informix 12.1
2525
Whatâs New in IWA 12.10.FC1
ï§ Refreshing Data in IWA
â Automatic Partition Refresh
â Trickle Feed (continuous refresh)
ï§ Additional SQL support for analytics in IWA
â UNION [ALL] queries
â New SQL OLAP functions
ï§ Additional interfaces for IWA administration
â OpenAdmin Tool (OAT) menu for IWA
â New SQL built-in routines for administering IWA
ï§ Improved Security
â New WAREHOUSE privilege required for administering IWA
- 26. © 2014 IBM Corporation
Informix 12.1
2626
Automatic Partition Refresh
Automatic IWA synchronization with
Informix, on-demand
Let Informix find the changed
partitions since last refresh and
refresh them in IWA for you
Easy adoption and maintenance
of Real-Time Analytics
With this enhancementâŠ
ï§A single command instructs IWA to
refresh only changed data partitions
from Informix database to IWA
ï§Applies to Fact and Dimension tables
BenefitsâŠ
ï§It removes the potentially error-prone
process for manual identification of
changed partitions in Informix
ï§Easier administration for keeping current
Informix data in IWA
- 27. © 2014 IBM Corporation
Informix 12.1
2727
Low Administration
Automated and fast small updates
keep IWA data current
Allows for Real/Right-Time
Analytics and Operational BI
Continuous Refresh: Trickle Feed
ifx_setupTrickleFeed
Tracks changes in Dimensions
Tracks inserts in Fact tables
Automated updates in IWA datamart
With this enhancementâŠ
ï§Incremental inserts to the Fact tables
and changes to Dimensions tables can be
continuously updated into IWA
ï§Changes can be at row level, which is
more granular than at partition level
BenefitsâŠ
ï§We can have âspeed of thoughtâ
analytics in a real-time data warehouse or
mixed workload environment
ï§Actionable analytics on operational data
- 28. © 2014 IBM Corporation
Informix 12.1
2828
Support of UNION [ALL] queries
BenefitsâŠ
ï§Fast response for operational and
business analytics workloads calling
heavy queries in UNION [ALL]
ï§Typical UNION use cases in BI tools:
ï§ OLAP/Cube operations: ROLL-
UP/ACROSS, AGGREGATE, GROUP
ï§ ETL: Extract, Slowly-Changing
Dimensions (SCD)
ï§ Cross-table queries and reports
ï§ Set operations: union/union all
Some or all of the queries in an UNION, will
be accelerated and run much faster
BI tools operations that use UNION behind
the scenes will run 100x+ faster
With this enhancementâŠ
ï§IWA can now accelerate previously long
running queries combined in an UNION or
UNION ALL operation
SELECT i_item_id, avg(cs_quantity) agg1, avg(cs_list_price)
agg2, avg(cs_coupon_amt) agg3, avg(cs_sales_price) agg4
FROM catalog_sales, customer_demographics, date_dim, item,
promotion
WHERE cs_sold_date_sk = d_date_sk and
cs_item_sk = i_item_sk and cs_bill_cdemo_sk = cd_demo_sk
and cs_promo_sk = p_promo_sk and
cd_gender = 'F' and cd_marital_status = 'M' and
cd_education_status = 'College' and (p_channel_email = 'N'
or p_channel_event = 'Nâ) and d_year = 2001
GROUP BY i_item_id
UNION ALL
SELECT i_item_id, avg(ws_quantity) agg1, avg(ws_list_price)
agg2, avg(ws_coupon_amt) agg3, avg(ws_sales_price) agg4
FROM web_sales, customer_demographics, date_dim, item,
promotion
WHERE ws_sold_date_sk = d_date_sk and ws_item_sk =
i_item_sk and ws_bill_cdemo_sk = cd_demo_sk and ws_promo_sk
= p_promo_sk and cd_gender = 'F' and cd_marital_status =
'M' and cd_education_status = 'College' and
(p_channel_email = 'N' or d_channel_event = 'N') and d_year
= 2001
GROUP BY i_item_id ;
- 29. © 2014 IBM Corporation
Informix 12.1
2929
Support of standard SQL OLAP functions
In-Database and In-Memory Analytics
Simplified Code for OLAP which can be
accelerated, much faster response times
Better Platform Integration and Utilization
With this enhancementâŠ
ï§Both Informix and IWA support ANSI
standard SQL On-Line Analytical
Processing (OLAP) functions:
â Ranking: RANK, DENSE_RANK,
DENSERANK, CUME_DIST,
PERCENT_RANK, NTILE
â Numbering: ROW_NUMBER, ROWNUMBER
â Aggregate: SUM, COUNT, AVG, MIN,
MAX, STDEV, VARIANCE, RANGE,
RATIO_TO_REPORT, RATIOTOREPORT
â First/Last: FIRST_VALUE,
LAST_VALUE
ï§Support of windowed aggregates:
Create windows partitions.
Apply OLAP function on
each row
Final
Order by
Join filters
Group by
Having
BenefitsâŠ
ï§Reduce SQL code and accelerate to get
much faster performance for OLAP or
multidimensional analysis
ï§Better integration and support for BI
tools like Cognos BI, and applications that
use standard OLAP SQL calls
ï§Increase performance by reducing
repeated scans, temporary tables and
aggregation needed to do OLAP
- 30. © 2014 IBM Corporation
Informix 12.1
3030
Administering IWA from OAT
to Monitor and Manage IWA
Web and Mobile Interface
As part of Informix administration tools
With this enhancementâŠ
ï§You can use the standard graphic
administration tool OpenAdmin Tool
(OAT), for all Informix administration tasks,
including the ones for IWA
BenefitsâŠ
ï§Easy to use graphic tool OAT can be
used to easily setup, integrated
administration environment
OLTP/OLAP
ï§No need to remember and run
commands or stored procedures to
manage IWA
- 31. © 2014 IBM Corporation
Informix 12.1
3131
Informi
x
Informix TimeSeries table Virtual Table Interface (VTI)
representation of TimeSeries table
Real-time
Analytics
IWA
IWA support for Time Series data
BenefitsâŠ
ï§High-performance right-time analytics on
big data collected from your sensors,
meters, events, GPS/location, RFIDs, to
anticipate and improve actions
ï§Combine TimeSeries and IWA for
operational actionable analytics based on
historic and current sensors data
ï§Unique platform, flexible, fast and
scalable, for the most challenging Big
Data and Smart Planet solutions
Right-Time Analytics on time-stamped
data
Big Data solutions on Sensor data
Operational Intelligence
With this enhancementâŠ
ï§You can include Time Series data
coming from smart sensors into IWA
ï§Data marts in IWA can be defined and
loaded from an Informixâ s Virtual Table
Interface (VTI) of your TimeSeries data
- 32. © 2014 IBM Corporation
Informix 12.1
3232
IWA data mart supports External Tables
Direct, fast and flexible way to leverage external
data for in-memory analytics
With this enhancementâŠ
ï§We can load data directly from
external tables into IWA data marts
without having to load it into Informix
database first
ï§Large external data in ASCII / binary
files or network devices âex: through
named pipesâ can be used to quickly
populate an IWA data mart
BenefitsâŠ
ï§Run extremely fast in-memory analytic
queries on operational data from non-
Informix external files and devices.
ï§Large amount of external data is quickly
loaded and made available in IWA, thanks
to high performance reads of Informix
External Tables and the no need for the
external data to be loaded into Informix
database first
ï§Storage savings and flexibility to do in-
memory analytics on large data in file
systems or devices and integrate it with
other SQL and NoSQL data in Informix.
- 33. © 2014 IBM Corporation
Informix 12.1
3333
IWA data mart supports synonyms and views
Fast analytic queries on SQL and NoSQL data
Analytics on data from different sources
More queries and datatypes can be accelerated
With this enhancementâŠ
ï§Until now, an IWA datamart could only
contain regular local tables, all in the
same database
ï§We can now create an IWA datamart that
uses remote tables in another Informix
DB and accelerate queries using those
remote tables
â By having a local synonym in the
Informix DB of the datamart, which points
to the remote Informix table
ï§We can include views as part of an IWA
datamart definition, and accelerate
queries that use views
â Views could map to a subset of another
Informix table or also to NoSQL data
â Use views to accelerate self-joins
BenefitsâŠ
ï§Ability to combine and accelerate queries
on local with remote tables, no need to
make all tables local
ï§Allows to be able to do accelerate self-
joins queries by using views
ï§Allows to accelerate data in JSON
collections by using views
ï§Fast analytic queries on views, typically
slow in SQL DBs due to on-the-fly view
materialization
- 34. © 2014 IBM Corporation
Informix 12.1
3434
IWA data mart supports of views and usage in NoSQL query (1)
ï§ From MongoDB shell:
â Create two collections (JSON): comments and users
ï§ From Informix:
â Create a view on each JSON collection (comments, users)
â Deploy an IWA data mart by probing a join between them:
â Run the accelerated query.
$ mongo demo_database
MongoDB shell version: 2.4.9
connecting to: demo_database
mongos> db.comments.insert( [
{ uid:12345, pid:444, comment:"first" },
{ uid:12345, pid:888, comment:"second" },
{ uid:99999, pid:444, comment:"third" }
] )
mongos> db.users.insert( [
{ uid:12345, name:"john" },
{ uid:99999, name:"mia" }
] )
mongos> exit
Example: Accelerating NoSQL data (in a JSON collection) using IWAâs view support
$ dbaccess demo_database -
> create view vcomments(uid,pid,comment) as
select
bson_value_int(data,'uid'),
bson_value_int(data,'pid'),
bson_value_varchar(data,'comment')
from comments;
> create view vusers(uid,name) as select
bson_value_int(data,'uid'),
bson_value_varchar(data,'name')
from users;
set environment use_dwa 'probe cleanup';
set environment use_dwa 'probe start';
select {+ avoid_execute} * from vcomments c,
vusers u where c.uid=u.uid;
set environment use_dwa 'probe stop';
execute procedure
ifx_probe2mart('demo_database','noSQL_mart');
execute function
ifx_createmart('demo_dwa','noSQL_mart');
execute function
ifx_loadmart('demo_dwa','noSQL_mart','NONE');
- 35. © 2014 IBM Corporation
Informix 12.1
3535
IWA data mart supports of views and usage in NoSQL query (2)
ï§ From Informix:
â Run the accelerated query on the JSON collection data:
ï§
Example: Accelerating NoSQL data (in a JSON collection) using IWAâs view support
set environment use_dwa 'accelerate on';
select c.uid,name,comment
from vcomments c, vusers u
where c.uid=u.uid and pid=444;
uid 12345
name john
comment first
uid 99999
name mia
comment third
- 36. © 2014 IBM Corporation
Informix 12.1
3636
IWA data mart view support to accelerate SQL-NoSQL query (1)
ï§ From Informix:
â We have an Informix table sqldoc1:
â We also have a JSON collection doc1: In Informix
using its JSON compatibility or its MongoDB driver:
Example: Accelerating a query combining SQL with NoSQL data (in a JSON
collection) using IWAâs view support
create table sqldoc1
( name varchar(10), value integer );
insert into sqldoc1 values ("John", 1);
insert into sqldoc1 values ("Scott", 2);
ï§ Create a view for the NoSQL data:
â Run the accelerated query on the JSON collection data:
create table doc1
( c1 serial, data BSON );
Insert into doc1(c1,data) values
(0, '{ fname:"John", lname:"Miller", age:21,
address: { street:"Informix
ave" } }'::JSON );
Insert into doc1(c1,data) values
(0, '{ fname:"Scott", lname:"Lashley",
age:21.50, address: { street:"Blazer ave" },
job:"Ref" }'::JSON );
create view viewdoc1 (c1,fname,lname,age,street)
as
SELECT c1, bson_value_lvarchar(data,"fname"),
bson_value_lvarchar(data,"lname"),
bson_value_double(data,"age"),
bson_value_lvarchar(data,"address.street")
FROM doc1;
> select * from viewdoc1;
c1 1
fname John
lname Miller
age 21.00000000000
street Informix ave
c1 2
fname Scott
lname Lashley
age 21.50000000000
street Blazer ave
2 row(s) retrieved.
- 37. © 2014 IBM Corporation
Informix 12.1
3737
IWA data mart view support to accelerate SQL-NoSQL query (2)
ï§ Probe the query we want to accelerate
â Use workload analysis to find datamart for a query
joining SQL table with NoSQL data (JSON collection)
â Deploy datamart proposed:
Example: Accelerating a query combining SQL with NoSQL data
select a.value,a.name,b.* from sqldoc1 a,
viewdoc1 b where a.value=b.c1
ï§ Run the query with acceleration. Works fine:
...
<mart name="dm_sqlnosql1">
<table name="sqldoc1" schema="root" isFactTable="true">
<column name="name"/>
<column name="value"/>
</table>
<table name="viewdoc1" schema="root" isFactTable="false">
<column name="age"/>
<column name="c1"/>
<column name="fname"/>
<column name="lname"/>
<column name="street"/>
</table>
<reference
referenceType="LEFTOUTER"
isRuntimeJoin="true"
parentCardinality="n"
dependentCardinality="n"
dependentTableSchema="root"
dependentTableName="sqldoc1"
parentTableSchema="root"
parentTableName="viewdoc1">
<parentColumn name="c1"/>
<dependentColumn name="value"/>
</reference>
</mart>
</dwa:martModel>
set environment use_dwa '3';
Environment set.
select a.value,a.name,b.* from sqldoc1 a, viewdoc1 b
where a.value=b.c1 ;
value 1
name John
c1 1
fname John
lname Miller
age 21.00000000000
street Informix ave
value 2
name Scott
c1 2
fname Scott
lname Lashley
age 21.50000000000
street Blazer ave
Online.log:
01:22:11 SQDWA: select a.value,a.name,b.* from sqldoc1 a,
viewdoc1 b where a.value=b.c
01:22:11 SQDWA: Identified 1 candidate AQTs for matching
01:22:11 SQDWA: matched: aqt46221ac7-8eae-4b9a-9275-
bd00dcca357c
01:22:11 SQDWA: matching successful (17 msec)
aqt46221ac7-8eae-4b9a-9275-bd00dcca357c
01:22:11 SQDWA: offloading successful (3036 msec)
- 38. © 2014 IBM Corporation
Informix 12.1
3838
ï§ Use workload analysis to find best IWA data
mart to accelerate these 3 queries:
â Self-Join using a view (v1) on the table (employee):
â Query on a view to filter rows or columns on the table:
â Query on the base table:
IWA data mart supports of views and usage for Self Join queries (1)
ï§ Create 2 views on a base table:
â One of the views (v1) will be used to implement a self
join of table âemployeeâ with itself.
create table "root".employee
(
employeeid integer,
lastname varchar(20),
country varchar(20),
departmentid integer
);
create view "root".v1
(employeeid,lastname,country,departmentid) as
select x0.employeeid ,x0.lastname
,x0.country ,x0.departmentid
from "root".employee x0 ;
create view "root".v2
(employeeid,lastname,country,departmentid) as
select x0.employeeid ,x0.lastname
,x0.country ,x0.departmentid
from "root".employee x0 where (x0.country =
'United States'
) ;
Example: Accelerating a self-join query, and queries on a table and a given view
SELECT Employee.EmployeeID, Employee.LastName,
Employee.EmployeeID, v1.LastName,
Employee.Country
FROM Employee INNER JOIN v1 -- self-join
ON Employee.Country = v1.Country;
SELECT EmployeeID, LastName, EmployeeID FROM v2;
SELECT EmployeeID FROM Employee;
- 39. © 2014 IBM Corporation
Informix 12.1
3939
IWA data mart supports of views and usage for Self Join queries (2)
ï§ Deploy IWA data mart produced
â Contains the base table (employee), views (v1) and
(v2), and self-join column relationship (employee, v1)
ï§ Run the queries enabling Acceleration:
â Run the accelerated query using view v1 for self-join:
â Run accelerated queries on the view v2 and base table
alone:
Example: Accelerating a Self-Join query using Views
<?xml version="1.0" encoding="UTF-8" ?>
<dwa:martModel
xmlns:dwa="http://www.ibm.com/xmlns/prod/dwa"
version="1.0">
<mart name="dm_empv1">
<table name="employee" schema="root"
isFactTable="true">
<column name="country"/>
<column name="employeeid"/>
<column name="lastname"/>
</table>
<table name="v1" schema="root" isFactTable="false">
<column name="country"/>
<column name="lastname"/>
</table>
<table name="v2" schema="root" isFactTable="true">
<column name="employeeid"/>
<column name="lastname"/>
</table>
<reference
referenceType="LEFTOUTER"
isRuntimeJoin="true"
parentCardinality="n"
dependentCardinality="n"
dependentTableSchema="root"
dependentTableName="employee"
parentTableSchema="root"
parentTableName="v1">
<parentColumn name="country"/>
<dependentColumn name="country"/>
</reference>
</mart>
SET ENVIRONMENT use_dwa â3â;
SELECT Employee.EmployeeID, Employee.LastName,
Employee.EmployeeID, v1.LastName,
Employee.Country
FROM Employee INNER JOIN v1 -- self-join
ON Employee.Country = v1.Country;
SET ENVIRONMENT use_dwa â3â;
SELECT EmployeeID, LastName, EmployeeID FROM v2;
SELECT EmployeeID FROM Employee;
- 40. © 2014 IBM Corporation
Informix 12.1
4040
IWA data mart supports of views and usage for Self Join queries (3)
ï§ From Informix:
â Run the accelerated query using view v1 for self-join:
â Run accelerated queries on the view v2 and base table alone:
Example: Accelerating a Self-Join query using Views
SET ENVIRONMENT use_dwa â3â;
SELECT Employee.EmployeeID, Employee.LastName,
Employee.EmployeeID, v1.LastName, Employee.Country
FROM Employee INNER JOIN v1 -- self-join
ON Employee.Country = v1.Country;
SET ENVIRONMENT use_dwa â3â;
SELECT EmployeeID, LastName, EmployeeID FROM v2;
SELECT EmployeeID FROM Employee;
- 41. © 2014 IBM Corporation
Informix 12.1
4141
sandor.szabo@de.ibm.com
- 42. © 2014 IBM Corporation
Informix 12.1
42
Handling Big Data without angst