1 not having an appropriate index can cause a full table

Assignment Help Database Management System
Reference no: EM13380386

1. Not having an appropriate index can cause a full table scan while performing the select statement by using a non-index field in the WHERE clause. Such queries will increase the logical read of the table and increase the disk input/output calls, i.e because such SQL statement will performs a row by row search to find the data that a query is looking for. For example consider a SQL statement and execute the same in SQLPLUS with the Explain plan option.

setautotracetraceonly explain

Select * from customer

Where Custlname = 'Dobson';

Execution Plan

----------------------------------------------------------

Plan hash value: 2844954298

------------------------------------------------------------------------------

| Id  | Operation         | Name     | Rows  | Bytes | Cost (%CPU)| Time     |

------------------------------------------------------------------------------

|   0 | SELECT STATEMENT  |          |     7 |   910 |   171   (1)| 00:00:03 |

|*  1 |  TABLE ACCESS FULL| CUSTOMER |     7 |   910 |   171   (1)| 00:00:03 |

------------------------------------------------------------------------------

This query will perform the full table scan on "CUSTOMER" table, because in the where condition we are using the non-index column "CUSTLNAME".

Now consider another example where we use Index column in our where condition.

setautotracetraceonly explain

Select * from customer

Where CustID = 98;

Execution Plan

----------------------------------------------------------

Plan hash value: 908218400

------------------------------------------------------------------------------------------

| Id  | Operation                   | Name       | Rows  | Bytes | Cost (%CPU)| Time     |

------------------------------------------------------------------------------------------

|   0 | SELECT STATEMENT            |            |     1 |   130 |     0   (0)| 00:00:01 |

|   1 |  TABLE ACCESS BY INDEX ROWID| CUSTOMER   |     1 |   130 |     0   (0)| 00:00:01 |

|*  2 |   INDEX UNIQUE SCAN         | CUSTOMERPK |     1 |       |     0   (0)| 00:00:01 |

------------------------------------------------------------------------------------------

This query will perform the Index unique scan on index "CUSTOMERPK" and will perform the table access by Index rowid.  Even we can see the execution time, CPU usage and cost difference between both the queries based on the Index usage.

One of the factor that can cause the problem by having too many index are,

For example consider a table "customerorderitem" in retaildba. This table is modified very often on daily basis, as many customers will be ordering the products or they will be returning the purchased product. If such tables contains too many indexes then this could cause a slow performance problem, i.e. because for every data modification in that table, each index needs to be updated. Which in turn will use more CPU, more memory and more I/O operation. But if any table is modified less often, then having more indexes most likely won't be a problem.

Statistics can be created on tables, indexes columns and as well as on the individual columns. But, if for some reason table or index statistics have not been updated, then this may result in a full table scan. This is because most RDBMS's have query optimizers that use those statistics to figure out if using an index is worth or not. The use of statistic will quickly determine which execution plan might product the fastest and most efficient execution plan.And if those statistics are not available, then the RDBMS may wrongly determine that doing a full table scan is more efficient than using an index.(Larsen,2013)

Reference no: EM13380386

Questions Cloud

Roots of polynomialwrite a program to find all real roots : roots of polynomialwrite a program to find all real roots of a given polynomial f. starting with 0.0 use step size of
Oracle has many features for managing and tracking users we : oracle has many features for managing and tracking users. we have discussed user accounts with username password
You have been hired as the cio of a large multinational : you have been hired as the cio of a large multinational internet advertising company. the president of the company is
Crescent manufacturing inc cmi is a luxury leader in : crescent manufacturing inc. cmi is a luxury leader in crafted and customized home furnishings. the corporate
1 not having an appropriate index can cause a full table : 1. not having an appropriate index can cause a full table scan while performing the select statement by using a
The order in which the tables in your queries are joined : the order in which the tables in your queries are joined can have an effect on the query performs. if your query is
1 a table scan is reading every record from the table in a : 1. a table scan is reading every record from the table in a sequential order to find the data that a query is looking
Within this project create a package called : within this project create a package called mycompletesystem1. author a new class within your newly created package
Learning outcomes assesseda describe and discuss the : learning outcomes assesseda describe and discuss the issues involved in managing software selection. b compare

Reviews

Write a Review

Database Management System Questions & Answers

  Solve the serious data redundancy problems

One of the many problems with data redundancy is the likely occurrence of data inconsistencies-two different initials have been entered for the teacher named Maria Cordon.)

  Discuss optimization techniques specific to data warehousing

Demonstrate the basic mechanisms for accessing relational databases from various types of application development environments.

  Metropolis toys is an independent family-owned manufacturer

metropolis toys is an independent family-owned manufacturer of wooden toys. the toys are designed by members of the

  Sort ascending by consultant id and date opened

Sort ascending by consultant ID and Date Opened. Don't show tickets with category ID of 0. HINT: You will require to use SELECT query with an alias in builder for the column.

  How could those redundancies lead to anomalies

What problem would you encounter if you wanted to produce a listing by city? How would you solve this problem by altering the file structure?

  Database management challenge than relational database

What is it about a 200 MB video or audio file which makes it so much more of database management challenge than relational database the same size?

  Draw an er diagram for database scenario

Draw an ER diagram for database scenario. Design a set of 3NF tables for your database scenario.

  You are to design a database for an insurance company the

you are to design a database for an insurance company. the data will include information about customers name address

  Using join sort results alphabetically by customer name

Using Join, list the items each customer ordered where the billing_price was lower than the item price (item, billing_price, and price). Sort the results alphabetically by customer name.

  Provide a description of relationships between organisation

Discuss how this organisation has responded to the introduction of Information Systems (IS) into their business paradigms. Highlight the advantages of IS, the disadvantages and the resultant shortfalls that must be addressed in this organisation.

  Explain eer model with data dictionary

Draw an EER model for the requirements identified in Part 1. The EER Model should be accompanied with a data dictionary which includes entity type table, relationship type table and attribute table.

  Design a database for an insurance company

Don't forget to underline key attributes for entity sets and include arrowheads indicating the multiplicity of relationships

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd