Showing posts with label Database Quizzes. Show all posts
Showing posts with label Database Quizzes. Show all posts

Wednesday, December 1, 2021

DBMS MCQ - What is query optimization

Multiple choices questions in DBMS, What is query optimization? Why a schedule is said to be non-conflict serializable?

DBMS MCQ - Query Optimization

< Previous                      

Next >

 

1.The activity of choosing an efficient execution strategy for processing a query is called as  

a) Query execution

b) Query optimization

c) Query plan evaluation

d) Query parsing

Answer: (b) Query optimization

Query optimization is a process of choosing the cheapest and efficient of several equivalent query execution plans by using the statistics about data. A query typically has many possible execution strategies, and the process of choosing a suitable one for processing a query is known as query optimization.

Why do we need to optimize the query?

As there are many equivalent transformations of the same high-level query, the aim of query optimization is to choose the one that minimizes resource usage.

Need more clarity? Please read further.

A query which is written by the user may not be the efficient one. Also, the query written by the user can be transformed into several equivalent (each one producing the same result) expressions (queries).

The cost of processing each of these equivalent expressions is different. One may be costly and the other may be cheap.

We do not expect users to write their queries so that they can be processed efficiently. Rather, we expect the system to construct a query-evaluation plan that minimizes the cost of query evaluation. This is where query optimization comes into play.

Query optimization is the process of selecting the most efficient query-evaluation plan from among the many strategies usually possible for processing a given query, especially if the query is complex.

 

< Previous                      

Next >


************************
Related posts:


Query optimization in dbms

Quiz questions with answers on DBMS concepts

Why do we need to optimize the query?

Why there are many equivalent query expressions for retrieving something?

Important aspect of query processing is query optimization

Tuesday, November 30, 2021

DBMS MCQ - When do we say that a schedule is not conflict serializable

Multiple choices questions in DBMS, When can we mention that a schedule is not a conflict serializable schedule? Why a schedule is said to be non-conflict serializable?

DBMS MCQ - Non-conflict serializable schedule

< Previous                      

Next >

1. A schedule is said to be non-conflict serializable if it has one or more of the following.

a) Blind writes

b) Blind reads

c) Conflicting instructions

d) Non-conflicting instructions

Answer: (a) Blind writes and (c) Conflicting instructinos

A schedule is not conflict serializable if it is not conflict equivalent to a serial schedule. And, it is not conflict equivalent if it has two or more transactions that have conflicting instructions (eg. read-write conflict, write-read conflict, and write-write conflict).

Also, the schedules that have transactions consisting of blind writes are also not conflict serializable schedules.

Following schedule is not a conflict serializable schedule because read(A) of T1 conflict with write(A) of T2. Also, write(A) is a blind write (blind write - a write operation executed by a transaction to update a data item without executing a read on the same data item is called blind write).

T1

T2

Read(A)

 

Write(A)

 

Write(A)

 

 

< Previous                      

Next >


************************
Related posts:


Non-conflict serializable schedule

Quiz questions with answers on DBMS concepts

Example schedule which is not conflict serializable

What is blind write?

What is conflicting instruction?

Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents

data recovery