Ingres/Vectorwise Implementation Details XXV Ingres Benutzerkonferenz 2012 Confidential © 2011 Actian Corporation Doug Inkster 1 of 9.

Slides:



Advertisements
Similar presentations
Tuning: overview Rewrite SQL (Leccotech)Leccotech Create Index Redefine Main memory structures (SGA in Oracle) Change the Block Size Materialized Views,
Advertisements

Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Database Performance Tuning and Query Optimization
Query Optimization Reserves Sailors sid=sid bid=100 rating > 5 sname (Simple Nested Loops) Imperative query execution plan: SELECT S.sname FROM Reserves.
Michael Pizzo Software Architect Data Programmability Microsoft Corporation.
The Relational Model and Relational Algebra Nothing is so practical as a good theory Kurt Lewin, 1945.
© IBM Corporation Informix Chat with the Labs John F. Miller III Unlocking the Mysteries Behind Update Statistics STSM.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 19 Algorithms for Query Processing and Optimization.
Chapter 15 Algorithms for Query Processing and Optimization Copyright © 2004 Pearson Education, Inc.
Data Warehouse Tuning. 7 - Datawarehouse2 Datawarehouse Tuning Aggregate (strategic) targeting: –Aggregates flow up from a wide selection of data, and.
Jingren Zhou Microsoft Corp.. Large-scale Distributed Computing Large data centers (x1000 machines): storage and computation Key technology for search.
Query Optimization CS634 Lecture 12, Mar 12, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
Manajemen Basis Data Pertemuan Matakuliah: M0264/Manajemen Basis Data Tahun: 2008.
Ingres/VectorWise Doug Inkster – Ingres Development.
Dos and don’ts of Columnstore indexes The basis of xVelocity in-memory technology What’s it all about The compression methods (RLE / Dictionary encoding)
Information Retrieval in Practice
Midterm Review Lecture 14b. 14 Lectures So Far 1.Introduction 2.The Relational Model 3.Disks and Files 4.Relational Algebra 5.File Org, Indexes 6.Relational.
CS263 Lecture 19 Query Optimisation.  Motivation for Query Optimisation  Phases of Query Processing  Query Trees  RA Transformation Rules  Heuristic.
ACS-4902 Ron McFadyen Chapter 15 Algorithms for Query Processing and Optimization.
CMSC724: Database Management Systems Instructor: Amol Deshpande
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 11 Database Performance Tuning and Query Optimization.
Chap8: Trends in DBMS 8.1 Database support for Field Entities 8.2 Content-based retrieval 8.3 Introduction to spatial data warehouses 8.4 Summary.
Query Processing & Optimization
Chapter 19 Query Processing and Optimization
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 11 Database Performance Tuning and Query Optimization.
Evaluation of Relational Operations. Relational Operations v We will consider how to implement: – Selection ( ) Selects a subset of rows from relation.
Query Execution Chapter 15 Section 15.1 Presented by Khadke, Suvarna CS 257 (Section II) Id
Chapter 8 Physical Database Design. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Overview of Physical Database.
Overview of Search Engines
Enhancements to the GROUP BY Clause Fresher Learning Program January, 2012.
Analysis Services 101 Dave Fackler, MCDBA, MCSE, MCT Director, Business Intelligence Practice Intellinet Corporation.
Ingres Plus X100 Equals Ingres Vectorwise. Agenda  Why?  Introduction to Vectorwise  Groundwork  Vectorwise and OPF  Vectorwise and QEF.
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 11 Database Performance Tuning and Query Optimization.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
Chapter 3 Single-Table Queries
Physical Database Design & Performance. Optimizing for Query Performance For DBs with high retrieval traffic as compared to maintenance traffic, optimizing.
CSCE Database Systems Chapter 15: Query Execution 1.
Database Management 9. course. Execution of queries.
Ingres/VectorWise Doug Inkster – Ingres Development.
SQL/Lesson 4/Slide 1 of 45 Using Subqueries and Managing Databases Objectives In this lesson, you will learn to: *Use subqueries * Use subqueries with.
Query Optimization Arash Izadpanah. Introduction: What is Query Optimization? Query optimization is the process of selecting the most efficient query-evaluation.
1-1 Homework 3 Practical Implementation of A Simple Rational Database Management System.
Views In some cases, it is not desirable for all users to see the entire logical model (that is, all the actual relations stored in the database.) In some.
1 Chapter 10 Joins and Subqueries. 2 Joins & Subqueries Joins – Methods to combine data from multiple tables – Optimizer information can be limited based.
T-SQL: Simple Changes That Go a Long Way DAVE ingeniousSQL.com linkedin.com/in/ingenioussql.
CS 257 Chapter – 15.9 Summary of Query Execution Database Systems: The Complete Book Krishna Vellanki 124.
CS4432: Database Systems II Query Processing- Part 2.
Chapter 8 Physical Database Design. Outline Overview of Physical Database Design Inputs of Physical Database Design File Structures Query Optimization.
An Introduction to SQL For CS Overview of SQL  It is the standard language for relational systems, although imperfect  Supports data definition.
CPSC 404, Laks V.S. Lakshmanan1 Evaluation of Relational Operations – Join Chapter 14 Ramakrishnan and Gehrke (Section 14.4)
05 | SET Operators, Windows Functions, and Grouping Brian Alderman | MCT, CEO / Founder of MicroTechPoint Tobias Ternstrom | Microsoft SQL Server Program.
Last Updated : 27 th April 2004 Center of Excellence Data Warehousing Group Teradata Performance Optimization.
A Guide to SQL, Eighth Edition Chapter Four Single-Table Queries.
File Processing : Query Processing 2008, Spring Pusan National University Ki-Joune Li.
Lecture 15: Query Optimization. Very Big Picture Usually, there are many possible query execution plans. The optimizer is trying to chose a good one.
1 Chapter 3 Single Table Queries. 2 Simple Queries Query - a question represented in a way that the DBMS can understand Basic format SELECT-FROM Optional.
Chapter 13: Query Processing
Database Systems, 8 th Edition SQL Performance Tuning Evaluated from client perspective –Most current relational DBMSs perform automatic query optimization.
Diving into Query Execution Plans ED POLLACK AUTOTASK CORPORATION DATABASE OPTIMIZATION ENGINEER.
1 Copyright © 2008, Oracle. All rights reserved. Repository Basics.
SQL IMPLEMENTATION & ADMINISTRATION Indexing & Views.
T-SQL: Simple Changes That Go a Long Way
Database Performance Tuning and Query Optimization
Chapter 15 QUERY EXECUTION.
Data warehouse Design Using Oracle
Advance Database Systems
Query Execution Presented by Jiten Oswal CS 257 Chapter 15
Contents Preface I Introduction Lesson Objectives I-2
Chapter 11 Database Performance Tuning and Query Optimization
Presentation transcript:

Ingres/Vectorwise Implementation Details XXV Ingres Benutzerkonferenz 2012 Confidential © 2011 Actian Corporation Doug Inkster 1 of 9

Abstract Confidential © 2011 Actian Corporation 2 This session investigates the interface between Ingres and Vectorwise in more detail. It describes changes made to Ingres to accommodate Vectorwise and changes made to Vectorwise to accommodate Ingres, as well as specific features of Vectorwise and how they are exploited from Ingres. of XX

Contents Ingres/VW overview In Ingres, not VW In VW, not Ingres Ingres/VW coordination Clever VW features and their exploitation Coming VW features

Ingres/Vectorwise Overview Queries arrive in Ingres server, processed (as needed) by VW server, as well Tables defined in Ingres catalogs as additional table type, but also in VW catalog Select/update/delete compiled in OPF, passed by QEF to VW server as VW query Insert/copy compiled in OPF, row images passed by QEF to VW server

Ingres/Vectorwise Overview VW algebra Generated by optimizer’s cross compiler Nested operators: Project, Select, TopN, Window, Sort, Aggr, OrdAggr, Mscan, MergeJoin1, HashJoin01, HashJoinN, CartProd Trace point op207 displays compiled query – use x100pp to format it

Sample VW query “select r_name, n_name from region, nation where r_regionkey = n_regionkey order by r_name” generates: Sort ( Project ( HashJoin01 ( MScan ( _nation = '_nation', [ '_n_regionkey', '_n_name'] ) [ 'est_card' = '25' ], [ _nation._n_regionkey ], MScan (_region = '_region', [ '_r_regionkey', '_r_name'] ) [ 'est_card' = '5' ], [ _region._r_regionkey ], 0 ) [ 'est_card' = '25' ], [_region._r_name, _nation._n_name] ),[_region._r_name] )

OP207/x100pp “set trace point op207” displays VW syntax, X100pp makes it readable Sort (Project (HashJoin01 (MScan ( _nation = '_nation', [ _n_regionkey', '_n_name‘]) [ 'est_card' = '25' ], [ _n_nation._n_regionkey ],MScan (_region = '_region', [ '_r_regionkey', '_r_name‘]) [ 'est_card' = '5' ], [ _region._r_regionkey ], 0) [ 'est_card' = '25' ], [_region._r_name, _nation. _n_name]), [_region. _r_name])

in Ingres, not VW Statistical aggregate functions (standard deviation, variance, regression, correlation) var_pop(x) defined in standard as: (s2 – s1*s1)/n/n – where s2 is sum(x*x), s1 is sum(x) and n is count(x) OPF rewriter replaces var_pop() function with expanded formula – same for other statistical aggs

in Ingres, not VW Vectorwise has no equivalent to Ingres SEjoin for handling difficult subqueries New flattening algorithms used e.g. “select * from p where pno >= all (select pno from sp where qty = 100)” is flattened to “select * from p, (select max(pno) as mpno, count(*) as cnt, count(pno) as cpno from sp where qty = 100) x where (p.pno >= mpno and cnt = cpno) or cnt = 0”

in VW, not Ingres “derived” notation in aggregate grouping e.g. “select custname, count(ordno) from customer, orders where custno = o_custno group by custno, custname” generates “… Aggr(…, [custno, custname DERIVED], [x = count(ordno)]), …” Ingres now tracks functional dependencies based on key constraints (primary, foreign key), equijoins, aggregation groupings, etc. Cross compiler determines applicability of DERIVED

Not in VW, not in Ingres GROUP BY enhancements: rollup, cube, grouping sets (new in 3.0) Defined in SQL standard using UNION SELECT … GROUP BY CUBE (a, b) transforms to: SELECT … GROUP BY a, b UNION ALL SELECT … GROUP BY a UNION ALL SELECT … GROUP BY b UNION ALL SELECT … GROUP BY () The transformation is handled entirely in the optimizer rewriter phase Works in VectorWise with no changes to VW Works for native Ingres with no changes to query execution facility

Ingres/VW Coordination Some features involve both Ingres and Vectorwise changes e.g. “select …, rank() over (partition by sno order by qty) as qrank …” generates: … Project( Sort( Mscan(‘sp’, [‘sno’, …, ‘qty’] ), [sp.sno, sp.qty] ), [TRSDM_0 = diff(sp.sno), TRSDM_1 = rediff(TRSDM_0, sp.qty), …, qrank = sqlrank(TRSDM_0, TRSDM_1)] ) …

Ingres/VW Coordination Vectorwise REUSE capability OPF identifies fragments of query appearing in multiple places (in UNIONs, in subqueries, …) Common fragment builds separate query plan component Vectorwise query caches initial instantiation of fragment Subsequent references to fragment processed against cached rows

Ingres/VW Coordination “select s_acctbal, s_name, p_partkey, p_mfgr, s_address, s_phone, s_comment from part, supplier, partsupp where p_partkey = ps_partkey and s_suppkey = ps_suppkey and... and ps_supplycost = ( select min(ps_supplycost) from partsupp, supplier where p_partkey = ps_partkey and s_suppkey = ps_suppkey)” Project ( HashJoin01 ( As ( IIREUSESQ6 = Project ( HashJoin01 ( MergeJoin1 ( MScan ( _partsupp000 = '_partsupp', [ '_ps_suppkey', '_ps_partkey', '_ps_supplycost', '__jpartsupp']... ), __VT_6_1_3_1 ), [ __VT_6_1_3_1._p_partkey, __VT_6_1_3_1._ps_supplycost ], As ( Aggr ( As ( IIREUSESQ6, __VT_6_0_3_2...

Clever Vectorwise Features Compression – data compressed using variety of techniques (type and value distribution dependent) Kept compressed in buffers Only expanded when being processed by query operators

Clever Vectorwise Features Even non-indexed columns max/min values stored with each disk block Restrictions are applied at the block level e.g. … where l_shipdate between date’ ’ and date‘ ’ … – will only read blocks with at least 1 row in the restricted range – clustering lineitem rows on o_orderdate effectively clusters on l_shipdate, too

Coming Vectorwise Features Just in time compilation – select portions of query for compiling into executable code – Project(), other operators computing expressions – Single call to compute entire expression, not one per operation Cooperative scans – Scan scheduler tracks different queries requesting scans on same tables/columns – Single scan shared by multiple executing queries

Coming Vectorwise Features Additional compression techniques Clustered Vectorwise New indexing techniques Intern program shared with CWI

Summary Exciting present Promising future