A Novel Approach of Query Optimization for Distributed Database Systems



Similar documents
Simple SQL Queries (3)

SUBQUERIES AND VIEWS. CS121: Introduction to Relational Database Systems Fall 2015 Lecture 6

Comp 5311 Database Management Systems. 3. Structured Query Language 1

Data Mining and Database Systems: Where is the Intersection?

Advance DBMS. Structured Query Language (SQL)

Introduction to SQL ( )

You can use command show database; to check if bank has been created.

SODDA A SERVICE-ORIENTED DISTRIBUTED DATABASE ARCHITECTURE

Chapter 6: Integrity Constraints

BUILDING BLOCKS OF DATAWAREHOUSE. G.Lakshmi Priya & Razia Sultana.A Assistant Professor/IT

A Multidatabase System as 4-Tiered Client-Server Distributed Heterogeneous Database System

Horizontal Aggregations In SQL To Generate Data Sets For Data Mining Analysis In An Optimized Manner

Preparing Data Sets for the Data Mining Analysis using the Most Efficient Horizontal Aggregation Method in SQL

Horizontal Aggregations in SQL to Prepare Data Sets for Data Mining Analysis

Outline. Mariposa: A wide-area distributed database. Outline. Motivation. Outline. (wrong) Assumptions in Distributed DBMS

Query Optimization Approach in SQL to prepare Data Sets for Data Mining Analysis

B2.2-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

A Knowledge Management Framework Using Business Intelligence Solutions

Lection 3-4 WAREHOUSING

Dataset Preparation and Indexing for Data Mining Analysis Using Horizontal Aggregations

Chapter 1: Introduction

A Critical Review of Data Warehouse

PartJoin: An Efficient Storage and Query Execution for Data Warehouses

TECHNIQUES FOR DATA REPLICATION ON DISTRIBUTED DATABASES

Lesson 8: Introduction to Databases E-R Data Modeling

Efficient Query Optimization for Distributed Join in Database Federation

How Can Data Sources Specify Their Security Needs to a Data Warehouse?

A Novel Cloud Computing Data Fragmentation Service Design for Distributed Systems

Elena Baralis, Silvia Chiusano Politecnico di Torino. Pag. 1. Query optimization. DBMS Architecture. Query optimizer. Query optimizer.

A Survey on Data Warehouse Architecture

MTCache: Mid-Tier Database Caching for SQL Server

Load Distribution in Large Scale Network Monitoring Infrastructures

Data Warehouse Snowflake Design and Performance Considerations in Business Analytics

Integrating Heterogeneous Data Sources Using XML

BUILDING OLAP TOOLS OVER LARGE DATABASES

Data W a Ware r house house and and OLAP Week 5 1

Basic Concepts. Chapter A: Network Model. Cont.) Data-Structure Diagrams (Cont( Data-Structure Diagrams. General Relationships. The DBTG CODASYL Model

Techniques to Produce Good Web Service Compositions in The Semantic Grid

Creation of Datasets for Data Mining Analysis by Using Horizontal Aggregation in SQL

Report on the Dagstuhl Seminar Data Quality on the Web

2 Associating Facts with Time

Implementation of P2P Reputation Management Using Distributed Identities and Decentralized Recommendation Chains

Chapter 1: Introduction

INTEGRATION OF XML DATA IN PEER-TO-PEER E-COMMERCE APPLICATIONS

We know how to query a database using SQL. A set of tables and their schemas are given Data are properly loaded

ACCELERATING SELECT WHERE AND SELECT JOIN QUERIES ON A GPU

Chapter 1: Introduction. Database Management System (DBMS)

EFFECTIVE DATA RECOVERY FOR CONSTRUCTIVE CLOUD PLATFORM

An Analysis on Density Based Clustering of Multi Dimensional Spatial Data

Chapter 14: Query Optimization

Turkish Journal of Engineering, Science and Technology

Associate Professor, Department of CSE, Shri Vishnu Engineering College for Women, Andhra Pradesh, India 2

QOS Based Web Service Ranking Using Fuzzy C-means Clusters

Udai Shankar 2 Deptt. of Computer Sc. & Engineering Madan Mohan Malaviya Engineering College, Gorakhpur, India

chapater 7 : Distributed Database Management Systems

SQL Query Evaluation. Winter Lecture 23

Grid Data Integration based on Schema-mapping

A REVIEW PAPER ON THE HADOOP DISTRIBUTED FILE SYSTEM

AN OVERVIEW OF DISTRIBUTED DATABASE MANAGEMENT

A QoS-Aware Web Service Selection Based on Clustering

The Study on Data Warehouse Design and Usage

Index Terms : Load rebalance, distributed file systems, clouds, movement cost, load imbalance, chunk.

Constraint-based Query Distribution Framework for an Integrated Global Schema

SQL is capable in manipulating relational data SQL is not good for many other tasks

Web-Based Genomic Information Integration with Gene Ontology

XML Data Integration in OGSA Grids

TOP-DOWN APPROACH PROCESS BUILT ON CONCEPTUAL DESIGN TO PHYSICAL DESIGN USING LIS, GCS SCHEMA

Fig. 3. PostgreSQL subsystems

DATABASE MANAGEMENT SYSTEMS

SEARCH ENGINE WITH PARALLEL PROCESSING AND INCREMENTAL K-MEANS FOR FAST SEARCH AND RETRIEVAL

ORGANIZATIONAL KNOWLEDGE MAPPING BASED ON LIBRARY INFORMATION SYSTEM

Log Mining Based on Hadoop s Map and Reduce Technique

... Foreword Preface... 19

DEVELOPMENT OF HASH TABLE BASED WEB-READY DATA MINING ENGINE

A Design and implementation of a data warehouse for research administration universities

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

Big Data Begets Big Database Theory

DLDB: Extending Relational Databases to Support Semantic Web Queries

E-Governance in Higher Education: Concept and Role of Data Warehousing Techniques

Fuzzy Multi-Join and Top-K Query Model for Search-As-You-Type in Multiple Tables

Transcription:

www.ijcsi.org 307 A Novel Approach of Query Optimization for Distributed Database Systems Deepak Sukheja 1, Umesh Kumar Singh 2 1: Priyatam Institute of Technology and Management Indore 452009, India. 2: Institute of Computer Science, Vikram University Ujjain, India Abstract Query optimization in distributed databases explicitly needed in many aspects of the optimization process, often making it imperative for the optimizer to consult underlying data sources while doing cost based optimization. This is not only increases the cost of optimization, but also changes the trade-offs involved in the optimization process significantly. The leading cost in this optimization process is the cost of costing that traditionally has been considered insignificant. The optimizer can only afford a few rounds of messages to the under- lying data sources and he nce the optimization techniques in this environment must be geared toward gathering all the required cost information with minimal communication. In this paper, we explore the design and s earch space for a que ry optimizer in distributed environment and de monstrate the need for this optimization approach in various aspects of the optimization process. This work present minimumcommunication cost query cost variants of various query optimization techniques, and di scuss tradeoffs in their performance in the present development. We have implemented a nov el optimization approach in the distributed database environment, somewhat unexpectedly, indicate that a simple two-phase optimization scheme performs fairly well as long as the physical database design is known to the optimizer, though more determined algorithms are required. Keyword: Query Optimization, Query Optimization approach, Query processing in DDBMS Introduction The need for distributed database services has increased dramatically in present working environment. Within enterprises, IT infrastructures are often decentralized as a result of mergers, acquisitions, and specialized corporate applications, resulting in deployment of large distributed databases. Possibly more significantly, the Internet and intranet have enabled new enterprise ventures including Business-to-Business Net Markets (or Hubs) [1, 2], who s business hinges on federating thousands of decentralized catalogs and other databases. In general, distributed database technology has been the subject of multiple research thrusts, including schema integration [3, 4], data transformation [2], as well as distributed query processing and optimization. The query optimization work goes back as far as the early distributed database systems (R*, SDD-1, Distributed Ingres [5, 7]), and the lot of research s recently has been focused on l inking data sources of various capabilities and cost models [8]. However, query optimization in the broad distributed environment presents peculiarities that change the trade-offs in the optimization process quite significantly. Distributed query processors need to consider three basic requirements: Need of Query Processing: I n a large scale distributed system, both data access and

www.ijcsi.org 308 computation can be carried out at various sites. For global efficiency, it is beneficial to consider assigning portions of a query plan in arbitrary distributed ways. In fact, this has been one of the major motivations for development of distributed database systems. Need of Cost Factors: In a c entralized DBMS, query execution cost is a single dimensional factor measured in conceptual units. In a distributed database, costs must be dividing into multiple dimensions under the control of single logical database. One proposal for a universal cost metric is hard currency, but typically there are other costs that are valuable to expose orthogonally, including response time, data freshness, and accuracy of computations [9, 10]. Need of Cost Estimation: This work is motivated by the necessity of the cost estimation in the part of the query optimizer from the optimization process. Apart from of the number of cost dimensions factor, a c entralized optimizer cannot accurately estimate the costs of operations at many autonomous sites. Z. G. Ives and A. Tomasic perposed middleware systems in [8, 11] address this problem by involving site specific wrappers in the optimization process, but they do not consider the cost of communicating with these wrappers. This cost is not significant in these systems because the wrappers typically reside in the same address space as the optimizer. But in general, the execution costs may also depend on transient system issues including inter communication cost between two sites [9]. Therefore co st estimation process must be distributed in a manner reflective of the query processing, with cost estimates being provided by the sites that would be doing the work. However, to the best of our knowledge, complete cost estimation, which requires the optimizer to communicate with the sites merely to find the cost of an operation, has not been studied before. In such a scenario, communication may become the dominant cost in the query optimization process. The high cost of costing raises a number of new design challenges, and adds additional factors to the complexity of distributed query optimization. Contributions of the Paper In this paper, consider a large space of distributed query optimizer design alternatives and argu the need for taking into consideration the high cost of optimization in heterogeneous environment. Accordingly, its present minimum communication cost factors of various well-known optimization approaches and presents an effective algorithms for query optimization in the distributed database environments. 2. Architecture and Problem Definition For query optimization purposes, the most relevant parts of the system are the query optimizer in the middleware, and the bidders at the fundamental sites (Figure 1). As in a cen tralized database system, the query optimizer could use a variety of different optimization algorithms, but the heterogeneous and distributed database system requires that the cost estimates be made by the original data sources or by the bidders. T he optimizer and the bidder communicate through use of two mechanisms: (1) Request for Bid (RFB) that the optimizer uses to request cost of an operation, and (2) Bid through which a bidder makes cost estimates. Fig1. System Architecture The Distributed Query Optimization Problem The distributed query optimization problem is to find an execution plan for a user specified query that satisfies an optimization goal provided by the user, this goal may be a function of many variables, including response time, total execution cost, accuracy and staleness of the data. For simplicity,

www.ijcsi.org 309 we concentrate on t wo of these factors, response time and total execution cost, though it is fairly easy to extend these to include other factors, assuming they can be easily estimated. Since we assume that the only information we have about the costs of operations is through the interface to the bidders, the optimization problem has to be restated as optimizing over the cost information exported by the bidders. Before describing the adaptations of the known query optimization algorithms to take into account the high cost of optimization, we will discuss two important issues that affect the optimization cost in this framework significantly. Query Optimization Approach To discuss the optimization technique and algorithm in this paper, it will make the following assumptions: Accurate Statistics: We assume that statistics regarding the cardinalities and the selectivity are available. This information can be collected through standard protocols that allow querying the host database about statistics, or by caching statistics from before query executions. Communication Costs: We assume that communication costs remain roughly constant for the duration of optimization and execution of the query, and that the optimizer can estimate the communication costs incurred in data transfer between any two sites involved in the query. No Pipelining Across Sites: We assume that there is no pipelining of data among query operators across sites. In general, all optimization algorithms break into three steps: Step 1: Choose subplans that require cost estimates and prepare the requests for bids. Step 2: Send messages to the bidders requesting costs. Step 3: Calculate the costs for plans/subplans. If possible, decide on an execution plan for the query, other- wise, repeat steps 2 and 3. Clearly we should try to minimize the number of repetitions of steps 2 a nd 3, s ince step 2 i nvolves expensive communication. The proposed algorithm has tried to minimize the retrieval of large datasets. The cost measure that we have considered is the size of the retrieved result sets. The proposed algorithm searches all possible plans for the query, using top down approach and the principle of optimality to cut subplans as early as possible. However the algorithm is finish it w orks in reasonable time in exponential nature and it is guaranteed to find the optimal plan for executing the query. Proposed optimization algorithms break into foure steps and these steps are as follows: Step 1: Catalog all feasible joins and multi-joins. (A feasible relation is defined as either a b ase relation or an intermediate relation that can be generated without Cartesian product; a feasible join is defined to be a join of two or more feasible relations that does not involve a Cartesian product). Step 2: Create bid requests for the joins and compute step 1 for scans on the base tables. Step 3: Request costs from the bidders for these join and scan operations. If input relations are intermediate table in that case for each join, only request the cost of performing that individual join and assuming that the input relations have already been computed. Step 4: Calculate the costs for plans/subplans recursively using classical dynamic programming (partial order dynamic programming if multidimensional costs are desired) and find the optimal plan for the query. Consider a banking enterprise (given in the text book) having the following relation schemas: branch (branch_name,branch_city,assets) customer ( customer_name, customer_street, customer_city) loan (loan_number,branch_name,amount) borrower (customer_name,loan_number) account (account_number, branch_name, balance) depositor (customer_name,account_number) We could distribute the tables among 3 sites: Site 1: branch Site 2: customer, borrower, depositor Site 3: loan, account There will be a central data dictionary which will contain the information regarding which tables are in which sites and the schema definition of the tables. Now consider a query: select customer_name, loan_number, amount from borrower, loanl where borrower.loan_number = Loan..loan_number and branch_name = Perryridge and amount > 1200;

www.ijcsi.org 310 select customer_name, borrower.loan_number,amount from borrower,loan where borrower.loan_number = loan.loan_number and branch_name = Perryridge and amount > 1200; Middle layer R1 Fig 3. R2 Site 1 Site 3 Site 2 Compute R1 X R2 branch loan, account customer, borrower, depositor Reslt set 1 Result set 2 Fig 2. Step 1: Look at the From clause and refer catalog for the central data dictionary to determine which sites are to be considered for this particular query. Create n number of SubSelect, SubFrom and SubWhere lists where n: no. of sites Distribute the SelectItems into the SubSelect(n) lists, FromItems into the SubFrom(n) lists. Step 2: Pick each item from the Where-Items list. If that clause belongs completely to a site, then include that clause into the corresponding SubWhere list. If a clause does not belong completely to one site then put that clause into a new list Final Where. Parse that clause to get the operands. Look for attributes of tables in individual operands. Find the sites to which these attributes belong to. If these attributes are not included in the respective Sub Select then include them. This step is one of the key steps in this algorithm. It is not intuitive and the example would help us understand it. Compute R1 X R2 Middle layer Select customer_name, borrower.loan_number from borrower Site 2 Select customer_name, borrower.loan number Site 3 Result set 1 Result set 2 Site 2 Site 3

www.ijcsi.org 311 Fig 4. Step 3: Using the SubSelect, SubFrom and SubWhere lists generate the subquery. FinalSelect = SelectItems FinalFrom = {R1,R2..,Rn) where n : no of sites and rn stands for the result set obtained from the nth site. Generate the final query from the FinalSelect, FinalFrom and FinalWhere lists. Execuation Plan: SUBQUERY[1] =NIL SUBQUERY[2] : SELECT CUSTOMER_NAME,B.LOAN_NUMBER FROM BORROWER ; SUBQUERY[3] : SELECT AMOUNT, L.LOAN_NUMBER FROM LOAN L WHERE BRANCH_NAME = PERRYRIDGE AND AMOUNT>1200; FINALQUERY : SELECT CUSTOMER_NAME,B.LOAN_NUMBER, AMOUNT FROM R2,R3 WHERE B.LOAN_NUMBER = LOAN.LOAN_NUMBER Where R1, R2 are result sets obtained from sites 2 and 3 respectively. select customer_name, borrower.loan_number,amount from borrower,loan where borrower.loan_number = loan.loan_number and branch_name = Perryridge and amount > 1200; Compute R1 X R2 Figure 5. Step 4: Execute the sub queries at the respective sites parallel (intra-query parallelism) and the final query at the middle layer. Conclusion A presented approach of query optimization is very useful for distributed database systems. To computations of cost from the optimization process, the optimizer must consult the data sources involved in an operation to find the cost of that operation. The mentioned analytical process indicate that, in many cases, especially when the physical database design is known to the optimizer, this query optimization algorithm works very well. In absence of such information, more aggressive optimization techniques must be used. References [1]Net market makers inc. http://www.netmarketmakers.com, 1999. [2] L. Knight. the e-market maker revolution, dataquest inc. www.netmarketmakers.com/documents/perspective1.pdf, 1999. [3] M. Lenzerini, and S.B. Navathe. A comparative analysis of methodologies for database scheme integration. ACM Computing Surveys, 15(4):323. 364 [4R. J. Miller, L. M. Haas, and M. Hernández, Schema Mapping as Query. Discovery, in VLDB, 2000, pp. 77 88.

www.ijcsi.org 312 [5] L. M. Haas, P. G. Selinger, E. Bertino, D. Daniels, B. G. Lindsay, G. M.. Lohman, Y. Masunaga, C. Mohan, P. Ng, P. F. Wilms, and R. A. Yost. R*: A research project on distributed relational dbms. IEEE Database Eng. Bull.,. 5(4):28 32. [7] P. A. Bernstein, N. Goodman, E. Wong, C. L. Reeve, and J. B. R.. Jr., Query processing in a s ystem for distributed databases (SDD-1),. TODS, vol. 6, no. 4, 1981. [15] R. S. Epstein, M. Stonebraker,... Databases Where Relations Are Hash Partitioned, TODS, vol. 16, no. 2, pp. 279 308. [8] Z. G. Ives, D. Florescu, M. Friedman, A. Y. Levy, and D. S.Weld. An adaptive query execution system for data integration.in SIGMOD, 1999. [9] R. Avnur, J.M. Hellerstein, B. Lo, C. Olston, B. Raman, V. Raman, T. Roth, and K. Wylie, "CONTROL: Continuous Output and Navigation Technology with Refinement On- Line", in Proc. SIGMOD Conference, 1998, pp.567-569. [10] C.Olston and J. Widom. Offering a precisionperformance tradeoff for aggregation queries over replicated data. vldb.org/conf /2000/pp. 144. [11] A. Tomasic, R. Amouroux, P. Bonnet, O. Kapitskaia, H. Naacke, and L. Raschid. The distributed information search component (DISCO) and the world wide web. In IEEE 1998, Volume: 10 Issue: 5 pp. 808-823.