What is Covering Indexes?
Plz explain with example
Answers were Sorted based on User's Feedback
An index covers the query if all the columns specified in
the query are part of the index. These are the columns that
are all columns referenced in the query, not just columns in
a WHERE clause.
eq:-SELECT DISTINCT lower(orig_airport) FROM Flights
here orig_airport is a index column.
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / binyam
A covering index is a non clustered index built upon all the
columns required to satisfy a SQL query without going to the
base table. If a query encounters an index and does not need
to refer to the underlying data table at all, then the index
can be considered a covering index.
To understand a covering index it is very important first
understand non clustered index. a non clustered index does
not affect the order of the data in the table pages,because
the leaf pages of a non clustered index and the data pages
of the table are separate .A pointer is required to navigate
from an index row to the data row. so when a query requests
columns that are not part of the non clustered index chosen
by the optimizer , a lookup is required .The lookup fetches
the corresponding data row from the table by the following
row locator value from the index row, requiring a logical
read on the data page besides the logical read on the index
page. However, if all the columns required by the query are
available in the index itself , them access to the data page
not required then this known as a covering index.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / virgilio
A covering index is when you run a Query and you use an
indexed field in you where Clause:
*--Primary Key Creates aclustered Index
Create table Students
(
Studentid int Primary Key not Null, *
StudentName Nvarchar(20) Null,
StudentLastName Nvarchar(20) Null
)
Se;ect * from Students where StudentID = 20
| Is This Answer Correct ? | 1 Yes | 2 No |
Define outer join?
Why use identity in sql server?
Difference between Inner vs outer joins?
How to delete an existing row with delete statements in ms sql server?
what are the steps you will take, if you are tasked with securing an sql server? : Sql server database administration
how do you determine the Load performance of any query in sql server {example how do u determine performance of a select stmnt which returns Dynamically many no of records ... some times 100,1000,10000 etc., }
What is a rownum?
What number sorts of privileges are accessible in sql?
How would you choose between a clustered and a non-clustered index?
What are the parts of a function?
How can your resolve deadlocks?
4 Answers IBM, IMS, Iron Mountain, NuWare,
You want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)