© Dennis Shasha, Philippe Bonnet – 2013 Communicating with the Outside.

Slides:



Advertisements
Similar presentations
Yukon – What is New Rajesh Gala. Yukon – What is new.NET Framework Programming Data Types Exception Handling Batches Databases Database Engine Administration.
Advertisements

Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Database Tuning Principles, Experiments and Troubleshooting Techniques Baseado nos slides do tutorial com o mesmo nome da autoria de: Dennis Shasha
Overview of performance tuning strategies Oracle Performance Tuning Allan Young June 2008.
Database System Concepts and Architecture
Lock Tuning. overview © Dennis Shasha, Philippe Bonnet 2001 Sacrificing Isolation for Performance A transaction that holds locks during a screen interaction.
Transaction Management Overview. Transactions Concurrent execution of user programs is essential for good DBMS performance. –Because disk accesses are.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13 Introduction to SQL Programming Techniques.
--What is a Database--1 What is a database What is a Database.
Fundamentals, Design, and Implementation, 9/e Chapter 12 ODBC, OLE DB, ADO, and ASP.
1 - Oracle Server Architecture Overview
Chapter 2 Database Environment. Agenda Three-Level ANSI-SPARC Architecture Database Languages Data Models Functions of DBMS Components of DBMS Teleprocessing.
1 C. Shahabi Application Programming for Relational Databases Cyrus Shahabi Computer Science Department University of Southern California
Communicating with the Outside. Hardware [Processor(s), Disk(s), Memory] Operating System Concurrency ControlRecovery Storage Subsystem Indexes Query.
The Architecture of Transaction Processing Systems
Client-server database systems and ODBC l Client-server architecture and components l More on reliability and security l ODBC standard.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Overview of Database Languages and Architectures.
Database System Architectures  Client-server Database System  Parallel Database System  Distributed Database System Wei Jiang.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Copying, Managing, and Transforming Data With DTS.
SEMESTER 1, 2013/2014 DB2 APPLICATION DEVELOPMENT OVERVIEW.
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
Getting connected.  Java application calls the JDBC library.  JDBC loads a driver which talks to the database.  We can change database engines without.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
Lecture On Database Analysis and Design By- Jesmin Akhter Lecturer, IIT, Jahangirnagar University.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Course Introduction Introduction to Databases Instructor: Joe Bockhorst University of Wisconsin - Milwaukee.
Chapter 2 CIS Sungchul Hong
CSC271 Database Systems Lecture # 4.
Database Environment Chapter 2 AIT632 Sungchul Hong.
Introduction: Databases and Database Users
2. Database System Concepts and Architecture
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Communicating with the Outside. Overview Package several SQL statements within one call to the database server Embedded procedural language (Transact.
Lecture On Introduction (DBMS) By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
Chapter 16 Methodology – Physical Database Design for Relational Databases.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
© Dennis Shasha, Philippe Bonnet 2001 Log Tuning.
Hibernate Persistence. What is Persistence Persist data to database or other storage.  In OO world, persistence means persist object to external storage.
Improving Database Performance Derrick Rapley
Chapter 1 Introduction to Databases. 1-2 Chapter Outline   Common uses of database systems   Meaning of basic terms   Database Applications  
3-Tier Client/Server Internet Example. TIER 1 - User interface and navigation Labeled Tier 1 in the following graphic, this layer comprises the entire.
1 CS 430 Database Theory Winter 2005 Lecture 2: General Concepts.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Efficient RDF Storage and Retrieval in Jena2 Written by: Kevin Wilkinson, Craig Sayers, Harumi Kuno, Dave Reynolds Presented by: Umer Fareed 파리드.
INTRODUCTION TO DBS Database: a collection of data describing the activities of one or more related organizations DBMS: software designed to assist in.
Database Concepts Track 3: Managing Information using Database.
Communicating with the Outside. Hardware [Processor(s), Disk(s), Memory] Operating System Concurrency ControlRecovery Storage Subsystem Indexes Query.
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
Object storage and object interoperability
Basics of JDBC Session 14.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems.
Lock Tuning. Overview Data definition language (DDL) statements are considered harmful DDL is the language used to access and manipulate catalog or metadata.
Last Updated : 12 th April 2004 Center of Excellence Data Warehousing Group Overview of Teradata Utilities.
Em Spatiotemporal Database Laboratory Pusan National University File Processing : Database Management System Architecture 2004, Spring Pusan National University.
CS 440 Database Management Systems Stored procedures & OR mapping 1.
Troubleshooting Dennis Shasha and Philippe Bonnet, 2013.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe.
Databases (CS507) CHAPTER 2.
Databases and DBMSs Todd S. Bacastow January 2005.
DEPTT. OF COMP. SC & APPLICATIONS
DBMS & TPS Barbara Russell MBA 624.
Stored Procedures – Facts and Myths
The Client/Server Database Environment
Introduction What is a Database?.
Database System Concepts and Architecture
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Data, Databases, and DBMSs
Database System Architectures
Presentation transcript:

© Dennis Shasha, Philippe Bonnet – 2013 Communicating with the Outside

© Dennis Shasha, Philippe Bonnet – 2013 Hardware [Processor(s), Disk(s), Memory] Operating System Concurrency ControlRecovery Storage Subsystem Indexes Query Processor Application

© Dennis Shasha, Philippe Bonnet – 2013 Database Programming Programming language + Call Level Interface –ODBC: Open DataBase Connectivity –JDBC: Java based API –OCI (C++/Oracle), CLI (C++/ DB2) –Perl/DBI ORM: Object-relational mapping

© Dennis Shasha, Philippe Bonnet – 2013 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: Use of meta-data description when submitting queries, accessing the result set Iterations over the result set

© Dennis Shasha, Philippe Bonnet – 2013 Client-Server Mechanisms Connection pooling and multiplexing when multiple clients access a server Communication buffer on the database server. One per connection. –If a client does not consume results fast enough, then the server holds resources until it can output the result. –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. No actual impact on a 100 Mb network. More sensitive in an intranet with low bandwidth.

© Dennis Shasha, Philippe Bonnet – 2013 Object-Orientation Considered Harmful authorized(user, type) doc(id, type, date) 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 = If each document is encapsulated in an object, the risk is the following: –Find types t authorized for user input select doc.type as t from authorized where user = –For each type t issue the query select id, date from doc where type = ; –The join is executed in the application and not in the DB!

© Dennis Shasha, Philippe Bonnet – 2013 Avoid User Interaction within a Transaction User interaction within a transaction forces locks to be held for a long time. Careful transaction design (possibly transaction chopping) to avoid this problem.

© Dennis Shasha, Philippe Bonnet – 2013 Minimize the Number of Roundtrips to the Database Avoid Loops: –Application programming languages offer looping facilities (SQL statements, cursors, positioned updates) –Rigid object-oriented programming might force such loops. Package several SQL statements within one call to the database server: –Embedded procedural language (Transact SQL) with control flow facilities. Use User Defined Functions (UDFs) when they select out a high number of records.

© Dennis Shasha, Philippe Bonnet – 2013 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.

© Dennis Shasha, Philippe Bonnet – 2013 Retrieve Needed Columns Only Avoid transferring unnecessary data Might prevent the use of a covering index. In the experiment the subset contains ¼ of the attributes. –Reducing the amount of data that crosses the application interface yields significant performance improvement.

© Dennis Shasha, Philippe Bonnet – 2013 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 Applications that allow the formulation of ad-hoc queries should permit users to cancel them.

© Dennis Shasha, Philippe Bonnet – 2013 Minimize the Number of Query Compilations 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.

© Dennis Shasha, Philippe Bonnet – 2013 Tuning the Application Interface Avoid user interaction within a transaction Minimize the number of roundtrips between the application and the database Retrieve needed columns only Retrieve needed rows only Minimize the number of query compilations

© Dennis Shasha, Philippe Bonnet – 2013 Bulk Loading Data Tools to bulk load data in each system. Tool parameters: –Bypass query engine –Avoid logging –No index update –No constraint check –Frequency of commits

© Dennis Shasha, Philippe Bonnet – 2013 Direct Path Loading records into the lineitem relation from TPCH Direct path loading bypasses the query engine and the storage manager. It is orders of magnitude faster than conventional path (with a commit every 100 records) and inserts (with a commit for each record). Experiment performed on Oracle8iEE on Windows 2000.

© Dennis Shasha, Philippe Bonnet – 2013 Batch Size Bulk load of records. Throughput increases steadily when the batch size increases to records.Throughput remains constant afterwards. Trade-off between performance and amount of data that has to be reloaded in case of problem. Experiment performed on SQL Server 2000 on Windows 2000.

© Dennis Shasha, Philippe Bonnet – 2013 Storage Engine Parameters Bulk load of records. As expected: –Turning off logging helps. –Collecting statistics hurts –Maintaining indexes incrementally hurts a lot. Experiment performed on IBM DB2 UDB V7.1 on Windows 2000.