Irjet V6i2217
Irjet V6i2217
© 2019, IRJET | Impact Factor value: 7.211 | ISO 9001:2008 Certified Journal | Page 1116
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 06 Issue: 02 | Feb 2019 www.irjet.net p-ISSN: 2395-0072
going on related to this topic. In following section, we try to The algorithms are based on alternative ways of interpreting
summarize some of optimization techniques focused on the operations of queries which involve the four types of
group-by, joins and nested sub-queries, Having clause, nesting, and may often improve the performance of nested
indexes, etc. queries by orders of magnitude.
Abhijit Banubakode, Virandra Dakhode, “Comparative He analyzes the fundamental structure of an SQL-like, block-
Analysis of Query Optimization in the Object-Oriented structured data language and how implementation suffers
Database & Relational Databases Using Clauses[1]” from the use of the inefficient nested-iteration method. He
presented comparative analysis of query optimization for shows that the algorithm improves the performance of
relational databases and object oriented database based on nested queries drastically. He also combines these
cost, cardinality and no of bytes. They focus on queries using algorithms into a coherent strategy for completely
where, group-by and having clauses. In this paper, they processing a general query of arbitrary complexity.
review the optimization technique, establishes the
experimental setup and explains the query evaluation Fazal Mithani, Sahista Machchhar and Fernaz Jasdanwala, “A
aspects. Their paper concludes that first if the group-by novel approach for SQL query optimization[4]” proposed a
clause applied before conditional statement then there is model to convert the input user SQL query into an optimized
significant cost reduction. The logic behind this optimization SQL query and aims to give assurance of reduced query
is based on the fact that a group-by reduces the cardinality of execution time. They propose a scheme/approach to take an
a relation, therefore if group by is evaluated early, it could input query and provide a detailed plan called a Query
reduce the cost of subsequent joins. Execution Plan (QEP) which includes related missing
indexes, Join ordering, multitable joins and performance
They explained this using an example query that computes issues with LIKE operator.
count of bank branches located in a particular city and total
count of branches in each city. In normal approach where Their process of query optimization for datasets is described
group-by is applied after condition i.e. first check the as the following. First of all input query need to be run & full
condition and then group on branch city, search time is more scan of dataset has to be performed. Then get the
and CPU cost is high. The optimization technique is to group information about database schema, number of joins,
on branch city first and then check the condition. This way if missing indexes, redundant usage of tables, etc. From this
group-by is applied before condition, search time and CPU information, find the alternate way to replace the method of
cost are proven to reduce significantly. query processing as per proposed scheme which identifies
the syntax, constraint information, join aggregation and
Weipeng P. Yan, Per Ake Larson, “Performing Group by freeze some of data. Then by using all these rewrite the input
before join[2]” proposed a new strategy for processing SQL query. Finally run the query and compare it with the input
queries containing group-by namely pushing the group-by query. It gives surety about performance by an optimized
operation past one or more joins. They consider sql queries execution. This proposed schema represents how the simple
containing joins and group by. They say that even though the query is going to be converted in to optimized query in very
standard way of evaluating this type of queries is to perform accurate proper way with minimum amount of time and it
all the join first and then the group by operation, it may be will reduce the cost of execution and increase the speed of
possible to perform group by early i.e. to push group by past retrieval of data.
one or more joins.
D.Saisanguansat and P.Jeatrakul,” Optimization Techniques
According to them, early grouping may reduce the query for PL/SQL [5]” presented optimization yechniques for
processing cost by reducing the amount of data participating PL/SQL like using index, out number technique, reducing
in joins. They stated necessary and sufficient conditions for sub-queries, etc. Using index technique is similar to the use
using their proposed transformation and also stated an of indexes in a book. Outnumber technique is to reuse the
algorithm for deciding whether a group by can pushed past a data values instead of repetitive calculation. Reducing sub-
join. They also noted some tradeoffs of this transformation queries is to reduce the number of sub-queries to minimum
and pointed out that reverse of the transformation is also possible count. They also presented combination technique
possible and can be beneficial sometimes. They showed that which involves combining multiple optimization techniques.
their strategy may result in significant savings in query
processing time. They assumed that queries were not They presented ten such optimization techniques and
containing ‘Having’ clause. showed that each technique can improve the performance.
Their results show that these techniques increase the
Won Kim, “On Optimizing an SQL-like Nested Query[3]” efficiency by at least 9.88% to 732.25%. Using index
suggest to transform the nested queries to equivalent, non- techniques was proven to be the best effective one.
nested queries that existing optimizers are designed to
process more efficiently. He develops algorithms which
transform nested queries to equivalent, non nested queries.
© 2019, IRJET | Impact Factor value: 7.211 | ISO 9001:2008 Certified Journal | Page 1117
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 06 Issue: 02 | Feb 2019 www.irjet.net p-ISSN: 2395-0072
-Can be used to load table from text file, this is usually [3] Won Kim, “On Optimizing an SQL-like Nested Query”,
20 times faster than using INSERT statements. ACM Transactions on Database Systems, Vol. 7, No. 3,
September 1982.
Use single INSERT statement with as much possible
multiple values rather than multiple single row INSERTS [4] Fazal Mithani, Sahista Machchhar and Fernaz Jasdanwala,
“A novel approach for SQL query optimization”, 2016 IEEE
-Can be used for inserting many rows from the same International Conference on Computational Intelligence and
client at the same time Computing Research.
Try to use column names instead of * in SELECT [5] D.Saisanguansat, P.Jeatrakul, “Optimization Techniques
statements for PL/SQL”, 14th International Conference on ICT and
Knowledge Engineering (ICT&KE) 2016.
Remove unnecessary tables from query joins
[6] Jean Habimana, “Query Optimization Techniques - Tips
Use WHERE to limit the size of result tables that are For Writing Efficient And Faster SQL Queries”, International
created with joins. Journal Of Scientific & Technology Research Volume 4, Issue
10, October 2015 ISSN 2277-8616 22.
Use LIMIT to sample Query Results
[7] Vamsi Krishna Myalapalli, ASN Chakravarthy and
Drop unused Indexes KeesariPrathap Reddy “Accelerating SQL Queries by
Unraveling Performance Bottlenecks in DBMS Engine”, 2015
© 2019, IRJET | Impact Factor value: 7.211 | ISO 9001:2008 Certified Journal | Page 1118
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 06 Issue: 02 | Feb 2019 www.irjet.net p-ISSN: 2395-0072
© 2019, IRJET | Impact Factor value: 7.211 | ISO 9001:2008 Certified Journal | Page 1119