Communicating with the outside

Similar documents
Increasing Driver Performance

Performance Tuning for the JDBC TM API

High-Performance Oracle: Proven Methods for Achieving Optimum Performance and Availability

Database System Architecture & System Catalog Instructor: Mourad Benchikh Text Books: Elmasri & Navathe Chap. 17 Silberschatz & Korth Chap.

ICOM 6005 Database Management Systems Design. Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 2 August 23, 2001

1 File Processing Systems

Tune That SQL for Supercharged DB2 Performance! Craig S. Mullins, Corporate Technologist, NEON Enterprise Software, Inc.

Chapter 2 Database System Concepts and Architecture

An Oracle White Paper May Guide for Developing High-Performance Database Applications

Using Oracle Real Application Clusters (RAC)

Java DB Performance. Olav Sandstå Sun Microsystems, Trondheim, Norway Submission ID: 860

1. INTRODUCTION TO RDBMS

Tier Architectures. Kathleen Durant CS 3200

Using DataDirect Connect for JDBC with Oracle Real Application Clusters (RAC)

What is Data Virtualization?

<Insert Picture Here> Oracle In-Memory Database Cache Overview

MDM Multidomain Edition (Version 9.6.0) For Microsoft SQL Server Performance Tuning

DISTRIBUTED AND PARALLELL DATABASE

CA IDMS Server r17. Product Overview. Business Value. Delivery Approach

Configuring Apache Derby for Performance and Durability Olav Sandstå

Data Management for Portable Media Players

There are four technologies or components in the database system that affect database performance:

Chapter 3. Database Environment - Objectives. Multi-user DBMS Architectures. Teleprocessing. File-Server

DB2 for i5/os: Tuning for Performance

Apache Derby Performance. Olav Sandstå, Dyre Tjeldvoll, Knut Anders Hatlen Database Technology Group Sun Microsystems

What is Data Virtualization? Rick F. van der Lans, R20/Consultancy

Performance rule violations usually result in increased CPU or I/O, time to fix the mistake, and ultimately, a cost to the business unit.

Oracle Database 11g: SQL Tuning Workshop

Configuring Apache Derby for Performance and Durability Olav Sandstå

Centralized Systems. A Centralized Computer System. Chapter 18: Database System Architectures

Optimize Oracle Business Intelligence Analytics with Oracle 12c In-Memory Database Option

What is a database? COSC 304 Introduction to Database Systems. Database Introduction. Example Problem. Databases in the Real-World

CASE STUDY: Oracle TimesTen In-Memory Database and Shared Disk HA Implementation at Instance level. -ORACLE TIMESTEN 11gR1

Benchmarks of SQL Query Performance for ODBC and Oracle Call Interface

DATABASE SYSTEM CONCEPTS AND ARCHITECTURE CHAPTER 2

Objectives. Distributed Databases and Client/Server Architecture. Distributed Database. Data Fragmentation

SOLUTION BRIEF. JUST THE FAQs: Moving Big Data with Bulk Load.

FileMaker 14. ODBC and JDBC Guide

Chapter 18: Database System Architectures. Centralized Systems

Optimizing Performance. Training Division New Delhi

SOLUTION BRIEF. Advanced ODBC and JDBC Access to Salesforce Data.

COSC 6374 Parallel Computation. Parallel I/O (I) I/O basics. Concept of a clusters

What Is Specific in Load Testing?

IJCSI International Journal of Computer Science Issues, Vol. 8, Issue 6, No 3, November 2011 ISSN (Online):

The continuum of data management techniques for explicitly managed systems

MS SQL Performance (Tuning) Best Practices:

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Fall 2007 Lecture 5 - DBMS Architecture

Sivakumar Software Engg, Zagro Singapore Pte Ltd .

Copyright 2014, Oracle and/or its affiliates. All rights reserved.

Toad for Oracle 8.6 SQL Tuning

Tushar Joshi Turtle Networks Ltd

Preview of Oracle Database 12c In-Memory Option. Copyright 2013, Oracle and/or its affiliates. All rights reserved.

SQL Server for developers. murach's TRAINING & REFERENCE. Bryan Syverson. Mike Murach & Associates, Inc. Joel Murach

FileMaker 13. ODBC and JDBC Guide

SQL Server Query Tuning

Oracle Database 11g: SQL Tuning Workshop Release 2

DBMS / Business Intelligence, SQL Server

Tips and Tricks for Using Oracle TimesTen In-Memory Database in the Application Tier

The Data Access Handbook

SAP Business Objects Business Intelligence platform Document Version: 4.1 Support Package Data Federation Administration Tool Guide

OLTP Meets Bigdata, Challenges, Options, and Future Saibabu Devabhaktuni

OTM Performance OTM Users Conference Jim Mooney Vice President, Product Development August 11, 2015

Java Virtual Machine: the key for accurated memory prefetching

Chapter 13. Introduction to SQL Programming Techniques. Database Programming: Techniques and Issues. SQL Programming. Database applications

Oracle TimesTen IMDB - An Introduction

Oracle Database In-Memory The Next Big Thing

CHAPTER 3 PROBLEM STATEMENT AND RESEARCH METHODOLOGY

Micro Focus Database Connectors

Database Toolkit: Portable and Cost Effective Software

Reporting trends and pain points of current and new customers IBM Corporation

Performance Implications of Various Cursor Types in Microsoft SQL Server. By: Edward Whalen Performance Tuning Corporation

Controlling Dynamic SQL with DSCC By: Susan Lawson and Dan Luksetich

Creating and Using Databases for Android Applications

Cache Database: Introduction to a New Generation Database

DataDirect XQuery Technical Overview

Raima Database Manager Version 14.0 In-memory Database Engine

Performance And Scalability In Oracle9i And SQL Server 2000

Why developers should use ODBC instead of native proprietary database interfaces

SequeLink Server for ODBC Socket

Virtuoso Virtual Database. Executive Summary. Virtuoso Virtual Database (VDB) Virtuoso VDB in focus

In Memory Accelerator for MongoDB

Using Apache Derby in the real world

OBJECTSTUDIO. Database User's Guide P

Load Testing and Monitoring Web Applications in a Windows Environment

Performance Counters. Microsoft SQL. Technical Data Sheet. Overview:

Architectural patterns for building real time applications with Apache HBase. Andrew Purtell Committer and PMC, Apache HBase

FileMaker 8. Installing FileMaker 8 ODBC and JDBC Client Drivers

FHE DEFINITIVE GUIDE. ^phihri^^lv JEFFREY GARBUS. Joe Celko. Alvin Chang. PLAMEN ratchev JONES & BARTLETT LEARN IN G. y ti rvrrtuttnrr i t i r

Distribution transparency. Degree of transparency. Openness of distributed systems

TIBCO ActiveSpaces Use Cases How in-memory computing supercharges your infrastructure

database abstraction layer database abstraction layers in PHP Lukas Smith BackendMedia

FileMaker 11. ODBC and JDBC Guide

Object Relational Mapping for Database Integration

MAKING ORACLE AND SQLJ WORK FOR YOU John Jay King, King Training Resources

Client Connectivity for Oracle Rdb

ANDROID APPS DEVELOPMENT FOR MOBILE GAME

Empress Embedded Database. for. Medical Systems

Cloud Computing at Google. Architecture

White Paper: 1) Architecture Objectives: The primary objective of this architecture is to meet the. 2) Architecture Explanation

Transcription:

Communicating with the outside

Application Query Processor Indexes Storage Subsystem Concurrency Control Recovery Operating System Hardware [Processor(s), Disk(s), Memory]

Accessing the Database Programming language + Call Level Interface ODBC: Open DataBase Connectivity JDBC: Java based API OCI (C++/Oracle), CLI (C++/ DB2) Perl/DBI

ODBC An application using the ODBC interface relies on: A driver manager, to load a driver that is responsible for the interaction with the target DB system The driver implements the ODBC functions and interacts with the DB server

Characterization of ODBC drivers SQL dialect: Generic ODBC drivers transform SQL statements that follow ODBC SQL grammar into the dialect of a particular DB system. Specific ODBC drivers assume SQL statements follow the dialect of the system they are connected to. Client-server communication mechanism: Generic ODBC drivers rely on a DB-independent comm layer; specific ODBC drivers exploit the particular mechanisms supported by the DB server => much faster

Specific vs generic ODBC drivers SQLServer, Oracle, DB2 have specific ODBC drivers Allow a program to run on different DB systems as long as queries are expressed in the dialect of the ODBC driver DataDirect Technologies and OpenLInk provide generic ODBC drivers Provide transparent portability But worse performance and loss of features

API pitfalls Cost of portability Layer of abstraction on top of ODBC drivers to hide discrepancies across drivers with different conformance levels. Beware of performance problems in this layer of abstraction: Iterations over the result set

ODBC vs. OCI ODBC vs. OCI on Oracle8iEE on Windows 2000 Iteration over a result set one record at a time. Prefetching is performed. Low OCI overhead when number of records transferred is small ODBC performs better when number of records transferred increases. Better job at prefetching.

Client-Server Data Access DB server produces results that are consumed by the application client The client is asynchronous wrt the server Communication buffer on the database server. One per connection. Two performance issues: 1. If a client does not consume results fast enough, then the server stops producing results and holds resources until it can output the result. A client program executing on a very slow machine can affect the performance of the whole DB system 2. Data is sent either when the communication buffer is full or when a batch is finished executing. Small buffer frequent transfer overhead Large buffer time to first record increases.

Object-Orientation Considered Harmful authorized(user, type) doc(id, type, date) If each document type is encapsulated in an object and each document instance is another object, the risk is the following: What are the document instances a user can see? SQL: select doc.id, doc.date from authorized, doc where doc.type = authorized.type and authorized.user = <input> Find types t authorized for user input select type as t from authorized where user = <input> For each type t issue the query select id, date from doc where type = <t>; The join is executed in the application and not in the DB!

Tuning the Application Interface 1. Avoid user interaction within a transaction 2. Minimize the number of roundtrips between the application and the database 3. Retrieve needed columns only 4. Retrieve needed rows only 5. Minimize the number of query compilations

1. Avoid User Interaction within a Transaction User interaction within a transaction forces locks to be held for a long time. Employ careful transaction design (possibly transaction chopping) to avoid this problem.

2. Minimize the Number of Roundtrips to the Database (a) Avoid Loops Application programming languages offer looping facilities (SQL statements, cursors, positioned updates) Embedding an SQL SELECT statement inside the loop means there will be application-to-db interaction in every iteration of the loop Better idea to retrieve a significant amount of data outside the loop and then use the loop to process the data Package several SQL statements within one call to the database server Embedded procedural language (e.g., TransactSQL) with control flow facilities. Many such languages are product specific, so they can reduce the portability of the application code

Loops Fetch 2000 records Loop: 200 queries No loop: 1 query Crossing the application interface too often hurts performances.

2. Minimize the Number of Roundtrips to the Database (b) Use User Defined Functions (UDFs) when they select out a high number of records. Scalar UDFs can be integrated within a query condition: they are part of the execution plan and they are executed on the DB server

User Defined Functions Function computes the number of working days between two dates. Function executed either on the database site (UDF) or on the application site Applying the UDF yields good performances when it helps reduce significantly the amount of data sent back to the application. 80% of the records: the records where the nb working days between the date of shipping and the date the receipt was sent is greater than 5 working days 20% of the records:. Is smaller than 5 working days

3. Retrieve Needed Columns Only Reasons why it is a good idea: Avoid transferring unnecessary data Retrieving an unneeded column might prevent the use of a covering index. Ex: if there is a dense composite index on last name and first name, then a query asking for all the first names of people whose last name is Costa can be answered by the index alone, provided no irrelevant atts are also selected In the experiment the subset contains ¼ of the attributes. Reducing the amount of data that crosses the application interface yields significant performance improvement.

4. Retrieve Needed Rows Only If the user is only viewing a small subset of a very large result set, it is best to Only transfer that subset Only compute that subset Use constructs such as TOP or FETCH FIRST Avoid cursors Applications that allow the formulation of ad-hoc queries should permit users to cancel them. Avoids holding resources when a user realizes she made a mistake or when a query takes too long to terminate

Cursors Query fetches 200000 56 bytes records Response time is a few seconds with a SQL query and more than an hour iterating over a cursor.

5. Minimize the Number of Query Compilations Query parsing and optimization is a form of overhead to avoid The compilation simple queries requires from 10,000 to 30,000 instructions; for complicated queries, requires from 100,000 to several million instructions Compilation requires read access to the system catalog. Can cause lock blocking if other transactions are accessing the catalog at the same time A well-tuned online relational environment should rarely perform query compilations The query plan resulting from a compilation should be quickly accessible by the processor use procedure cache for this purpose and be sure the cache is big enough.

Benefits of precompiled queries Prepared execution yields better performance when the query is executed more than once: No compilation No access to catalog. Prepared execution plans become obsolete if indexes are added or the size of the relation changes. Experiment performed on Oracle8iEE on Windows 2000.