0% found this document useful (0 votes)
19 views24 pages

ODBS

The document contains Samya Pal's details like name, roll number, program, and semester for the course "Open Source DB Systems" with code DCA8142. It also contains her answers to two questions on concurrency control problems and ACID properties in transaction management. The concurrency control problems discussed are dirty read, unrepeatable read, phantom read, lost update, and incorrect summary. The ACID properties explained are atomicity, consistency, isolation, and durability.

Uploaded by

Samya Pal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views24 pages

ODBS

The document contains Samya Pal's details like name, roll number, program, and semester for the course "Open Source DB Systems" with code DCA8142. It also contains her answers to two questions on concurrency control problems and ACID properties in transaction management. The concurrency control problems discussed are dirty read, unrepeatable read, phantom read, lost update, and incorrect summary. The ACID properties explained are atomicity, consistency, isolation, and durability.

Uploaded by

Samya Pal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Name: SAMYA PAL

Roll No: 2114504018


Program: MCA
Semester: Sem3
Course Name: OPEN SOURCE
DB SYSTEMS
Code: DCA8142
Assignment Set – 1

Q1.

a. Explain different concurrency control problems.


Ans: Several problems that arise when numerous transactions execute simultaneously in a
random manner are referred to as Concurrency Control Problems.
Dirty Read Problem
The dirty read problem in DBMS occurs when a transaction reads the data that has been
updated by another transaction that is still uncommitted. It arises due to multiple uncommitted
transactions executing simultaneously.
Example: Consider two transactions A and B performing read/write operations on a data
DT in the database DB. The current value of DT is 1000: The following table shows the
read/write operations in A and B transactions.

Time A B

T1 READ(DT) ------

T2 DT=DT+500 ------

T3 WRITE(DT) ------

T4 ------ READ(DT)

T5 ------ COMMIT

T6 ROLLBACK ------

Transaction A reads the value of data DT as 1000 and modifies it to 1500 which gets stored
in the temporary buffer. The transaction B reads the data DT as 1500 and commits it and the
value of DT permanently gets changed to 1500 in the database DB. Then some server errors
occur in transaction A and it wants to get rollback to its initial value, i.e., 1000 and then the
dirty read problem occurs.
Unrepeatable Read Problem
The unrepeatable read problem occurs when two or more different values of the same data
are read during the read operations in the same transaction.
Example: Consider two transactions A and B performing read/write operations on a data
DT in the database DB. The current value of DT is 1000: The following table shows the
read/write operations in A and B transactions.

Time A B

T1 READ(DT) ------
Time A B

T2 ------ READ(DT)

T3 DT=DT+500 ------

T4 WRITE(DT) ------

T5 ------ READ(DT)

Transaction A and B initially read the value of DT as 1000. Transaction A modifies the
value of DT from 1000 to 1500 and then again transaction B reads the value and finds it to be
1500. Transaction B finds two different values of DT in its two different read operations.

Phantom Read Problem


In the phantom read problem, data is read through two different read operations in the same
transaction. In the first read operation, a value of the data is obtained but in the second
operation, an error is obtained saying the data does not exist.
Example: Consider two transactions A and B performing read/write operations on a data
DT in the database DB. The current value of DT is 1000: The following table shows the
read/write operations in A and B transactions.

Time A B

T1 READ(DT) ------

T2 ------ READ(DT)

T3 DELETE(DT) ------

T4 ------ READ(DT)

Transaction B initially reads the value of DT as 1000. Transaction A deletes the data DT
from the database DB and then again transaction B reads the value and finds an error saying
the data DT does not exist in the database DB.

Lost Update Problem


The Lost Update problem arises when an update in the data is done over another update but
by two different transactions.
Example: Consider two transactions A and B performing read/write operations on a data
DT in the database DB. The current value of DT is 1000: The following table shows the
read/write operations in A and B transactions.
Time A B

T1 READ(DT) ------

T2 DT=DT+500 ------

T3 WRITE(DT) ------

T4 ------ DT=DT+300

T5 ------ WRITE(DT)

T6 READ(DT) ------

Transaction A initially reads the value of DT as 1000. Transaction A modifies the value of
DT from 1000 to 1500 and then again transaction B modifies the value to 1800. Transaction A
again reads DT and finds 1800 in DT and therefore the update done by transaction A has been
lost.

Incorrect Summary Problem


The Incorrect summary problem occurs when there is an incorrect sum of the two data.
This happens when a transaction tries to sum two data using an aggregate function and the
value of any one of the data get changed by another transaction.
Example: Consider two transactions A and B performing read/write operations on two data
DT1 and DT2 in the database DB. The current value of DT1 is 1000 and DT2 is 2000: The
following table shows the read/write operations in A and B transactions.

Time A B

T1 READ(DT1) ------

T2 add=0 ------

T3 add=add+DT1 ------

T4 ------ READ(DT2)

T5 ------ DT2=DT2+500

T6 READ(DT2) ------

T7 add=add+DT2 ------

Transaction A reads the value of DT1 as 1000. It uses an aggregate function SUM which
calculates the sum of two data DT1 and DT2 in variable add but in between the value of DT2
get changed from 2000 to 2500 by transaction B. Variable add uses the modified value of DT2
and gives the resultant sum as 3500 instead of 3000.
b. Explain ACID properties in transaction management.
Ans: Transactions refer to the single logical units of work that access and (possibly) modify
the contents present in any given database. We can access the transactions using the read and
write operations.
If we want to maintain database consistency, then certain properties need to be followed in
the transactions known as the ACID (Atomicity, Consistency, Isolation, and Durability)
properties. Let us discuss them in detail.

A – Atomicity
Atomicity means that an entire transaction either takes place all at once or it doesn’t occur
at all. It means that there’s no midway. The transactions can never occur partially. Every
transaction can be considered as a single unit, and they either run to completion or do not get
executed at all. We have the following two operations here:
—Commit: In case a transaction commits, the changes made are visible to us. Thus,
atomicity is also called the ‘All or nothing rule’.
—Abort: In case a transaction aborts, the changes made to the database are not visible to
us.
Consider this transaction T that consists of T1 and T2: Transfering 100 from account A to
account B.
In case the transaction fails when the T1 is completed but the T2 is not completed (say,
after write(A) but before write(B)), then the amount has been deducted from A but not added
to B. This would result in a database state that is inconsistent. Thus, the transaction has to be
executed in its entirety in order to ensure the correctness of the database state.

C – Consistency
Consistency means that we have to maintain the integrity constraints so that any given
database stays consistent both before and after a transaction. If we refer to the example
discussed above, then we have to maintain the total amount, both before and after the
transaction.
Total after T occurs = 400 + 300 = 700.
Total before T occurs = 500 + 200 = 700.
Thus, the given database is consistent. Here, an inconsistency would occur when T1
completes, but then the T2 fails. As a result, the T would remain incomplete.

I – Isolation
Isolation ensures the occurrence of multiple transactions concurrently without a database
state leading to a state of inconsistency. A transaction occurs independently, i.e. without any
interference. Any changes that occur in any particular transaction would NOT be ever visible
to the other transactions unless and until this particular change in this transaction has been
committed or written to the memory.
The property of isolation ensures that when we execute the transactions concurrently, it
will result in such a state that’s equivalent to the achieved state that was serially executed in a
particular order.
Let A = 500, B = 500
Let us consider two transactions here- T and T”
Suppose that T has been executed here till Read(B) and then T’’ starts. As a result, the
interleaving of operations would take place. And due to this, T’’ reads the correct value of A
but incorrect value of B.
T’’: (X+B = 50, 000+500=50, 500)
Thus, the sum computed here is not consistent with the sum that is obtained at the end of
the transaction:
T: (A+B = 50, 000 + 450 = 50, 450).
It results in the inconsistency of a database due to the loss of a total of 50 units. The
transactions must, thus, take place in isolation. Also, the changes must only be visible after we
have made them on the main memory.

D – Durability
The durability property states that once the execution of a transaction is completed, the
modifications and updates on the database gets written on and stored in the disk. These persist
even after the occurrence of a system failure. Such updates become permanent and get stored
in non-volatile memory. Thus, the effects of this transaction are never lost.
Q2.

a. Briefly explain the various models of open-source software model.


Ans:
Some of the most used OSS models are:
 Build and Fix Model.
 Rapid Prototype Model.
 Spiral Model

Build and fix model

A greater part of the Open-Source project’s development life cycle comes under
this model because it is designed to fix some explicit problem experienced by a
developer or a programmer or system administrator. If the product is a success,
sooner or later it evolves from this model into a complete product satisfying the
design requirements and meeting user needs. For example, the Apache project
started sharing patches to the web server of NCSA (National Centre for
Supercomputing Applications). Today, it has developed into the most popular
server connected to the Internet. Fig 1 depicts the lifecycle of a Build and Fix model
approach.
Rapid prototype model

It is a classic solution for a defined system design problem. Several Open-Source


projects secure their development attempt on this model, as it offers the users a
workable product and encourages user partnership for design enhancement. At the
time of release, both analysis and extensive testing are required, otherwise, the
project will suffer from a lack of developer contribution so open Source projects
that started off as rapid prototypes during early releases usually fail to continue
succession under this model.
Spiral model
This model follows a circular approach wherein the various software development
phases like analysis, design, implementation, and testing happen for each
release/module and these phases keep on repeating as shown in Fig 2. Generally,
the target goal of the software is not clear at the beginning of such a development.
This process continues until the completed product is ready for operational release.
The spiral model is usually used in combination with other models depending on
the project’s capacity and the number of users affected like other models. It provides
widespread risk analysis throughout the development life cycle for large-scale
software applications. Many sample systems are created based on verification and
risk analysis criteria. The following fig 2 shows the spiral model.
b. What is forking? Explain forking in brief.
Ans: Forking is to take the source code from an open source software program and
develop an entirely new program.
Forking is often the result of a deadlock in an open source project that is so
insurmountable that all work stops. Typically this happens when development team
members are unable to resolve personal conflicts or fail to reach a consensus about next
steps. Forks may also occur when core members of an open source development team
decide not to address use cases that other members of the development community feel
are important.
Software forks can be controversial when they duplicate efforts, but most developers
agree that the right to fork is open source software's greatest strength. A successful fork
can save development time, inspire other uses for old code and create new business
opportunities. To be considered a fork, the newer version of the software must have its
own name and its own developer community. When a new program remains compatible
with the original program, it is referred to as a shallow fork.
The name fork is derived from the POSIX standard for operating systsems. In this
context, a fork is a process that generates a copy of itself.
Q3.

a. Explain relational model concepts and Relational algebra operations


in detail.
Ans:
RELATIONAL MODEL CONCEPTS
The relational model is a data model. In the relational model, we can represent the
database as a collection of relations. Relations are represented as tables. Each table
consists of a set of values or records. The figure 1 shows an example of a relational
model database.
In the given example, the first table is a STUDENT table in which each row represents
the details of a particular student entity. The column names are Name, Student Number,
Class, and Major. These columns specify how to interpret the data values in each row,
based on the column value. The values in a column are of the same data type.
In the case of the relational model, we can call a row as a ‘tuple’ and a column is called
an ‘attrib- ute’ and the table itself is known as a relation’. The data type describing the
types of values that can appear in each column is called a domain.
RELATIONAL ALGEBRA

In addition to defining the database structure and constraints, a data model must include
a set of operations to manipulate the data. A basic set of relational model operations
constitute relational algebra. These operations enable the user to specify basic retrieval
requests. A sequence of relational algebra operations forms a relational algebra
expression, whose result will also be a relation.
The relational algebra operations are usually divided into two groups. One group
includes set operations from mathematical set theory. Set operations include UNION,
INTERSECTION, SET DIFFERENCE, and CARTESIAN PRODUCT. The other
group consists of operations developed specifically for relational databases; these
include SELECT, PROJECT, and JOIN. The SELECT and PROJECT operations are
discussed first because they are the simplest. Then we will see the set operations.
Finally, we discuss JOIN and other complex operations. The relational database shown
in Figure 3 is used for our examples.

b. Explain aggregate functions in MySQL with examples.


Ans:
Aggregate Functions
Sometimes we need information based on the data stored in the tables. That means, we
can calculate some information from the given data which is not stored in the table
separately. For example, we cannot get the total price of books by simply querying from
the book details table because it is not stored in there. For these types of calculations,
we need aggregate functions.
By definition, aggregate functions perform a calculation on a set of records and return
a single value. An aggregate function except the COUNT function ignores NULL
values when it performs the calculation. The aggregate functions are often used with
GROUP By clause in the SELECT statement. Some common aggregate functions are
described below.
a) SUM Function
This function returns the sum of all values in an expression. To bet the total price of
books, we can use SUM function and GROUP BY clause.
SELECT book id, sum (price Each * quantity Ordered) total FROM book details
GROUP by bookid

The output is given below: Book id total


---------- ---------
B111 80523
B1234 23456
B1144 54678

b) AVG
AVG is used to calculate the average value of an expression and it ignores NULL
values. The general syntax is:
AVG(expression)
For example, we can use AVG function to calculate the average price of all books by
using the
following query:
SELECT AVG(Price) average_book_price FROM books
The output is given below:
average_book_price
-----------------
524

c) MAX and MIN function


MAX and MIN function returns the maximum and minimum values of a set of values
in an
expression. The general syntax is given below:
MAX(expression)
MIN(expression)
For example, we can use MIN and MAX functions to retrieve the highest and lowest-
price
books as follows:
SELECT MAX(Price) highest_price, MIN(Price) lowest_price
FROM Books
And the output is given below,
highest_price lowest_price

------------- ------------
800 150

d) COUNT function
The COUNT function returns the count (number) of the items in expression. We can
use the COUNT function to get the number of books in the book table as follows:
SELECT COUNT(*) AS Total
FROM books
The output is given below: Total
------
220
Assignment Set – 2
Q4.

a. Explain different data types used in PHP.


Ans: PHP has a total of eight data types that can be used to construct variables. They are,

1) Integers
2) Doubles
3) Booleans
4) NULL
5) Strings
6) Arrays
7) Objects
8) Resources.
In the above types, t he first five are simple types and the next two (arrays and objects)
are compound.

1) Integers
Integers are whole numbers without a decimal point. They are the simplest types. They
can be either positive or negative. We can declare a variable like,
$ int_var = 3456;
$ a =-567
Integers can be in decimal (base 10), hexadecimal (base 16), and octal (base 8) format.
this decimal is the default format. Hexadecimal can be represented as 0X and octal
integers with a leading 0.

2) Doubles
These are numbers with a floating-point like 3.145 or 52.3. we can declare a double
number as
$ dou_var = 5.554;
$ b = 8.167

3) Boolean
The Boolean type can have only two possible values. They are TRUE or FALSE. PHP
Provides a couple of constants TRUE or FALSE for use as Booleans. For example,
If (TRUE)
Print (“this is true statements”); Else
Print (“this is false statements”);
We can interpret other statements as Booleans. If a value is a number, if it is false, it is
exactly equal to zero and true otherwise. If a string is empty, then it is false and
Otherwise true. Values of type NULL are always false. If the variable is an array and it
contains no values then it is false otherwise it is true. Valid resources in which if a
function can return that resource then it is true, otherwise it is false. We can’t use double
as Booleans.
4) NULL
NULL is a special type that only has one value that is NULL. To give a variable NULL
value, we can declare like,
&sample = NULL;

5) Strings
Strings are sequences of characters. We can declare a string like,
$string1= “this is an example string”;
In a string, the escape sequence replacements are,
\n – is replaced by the newline character
\r – is replaced by the carriage-return character
\t – is replaced by the tab character
\$ – is replaced by the dollar sign
\” – is replaced by the single double-quote
\\ – is replaced by the single backslash

6) Arrays
The array is a special variable that can store multiple values of the same type. There
are 3 types of arrays that can be used. They are, Indexed arrays -Arrays with numeric
index, Associative arrays - Arrays with named keys, and Multidimensional arrays -
Arrays containing one or more arrays.
For example, consider the array given below.
$colors= array (“red”,”green”,”blue”);
And each color can access using index. That is,
$colors[0] = “red”;
$colors[1]=”green”;
$colors[2]=”blue”;

7) Objects
Another variable type is an object. We can create an object using the keyword ‘new’.
Consider the example,
<?php? Class AB
{
Function display ()
{
Print “doing example”;
}
}
$a1= new AB;
$a1->display ();
?>
8) Resources
The resource is a special variable holding a reference to an external variable or resource.
A resource with no more references to it will delete automatically

b. Describe Postgres95 and PostgreSQL in detail.


Ans: In 1995, students from Stonebraker’s lab, Andrew Yu and Jolly Chen replaced
Postgres with an extended subset of SQL. Postgres95 code was completely ANSI C and
trimmed in size by 25%. Many internal changes improved performance and maintainability.

Main enhancements added in Postgres95 are given below:


 The query language Post QUEL was replaced with structured query language
(SQL). Support for Aggregate functions was also added. The GROUP BY query
clause was added with aggregate functions.
 For interactive SQL queries, programming SQL was also added. This was similar
to the PL/ SQL of Oracle.
 Tcl - based clients were supported by a new front-end library, called ‘libpgtcl’.
 A large-object interface was also added.
 The instance-level rule system was removed. Rules were still available as rewritten
rules
 With the source code, a tutorial describing regular SQL features as well as those of
Postgres95 was distributed.

Postgres95 is an open source free cost software.

POSTGRESQL
The main advantage of Postgres95 is that it provided SQL support to the database. So in
1996, it was renamed PostgreSQL. During Postgres95 development, more emphasis was
given to identifying and understanding existing problems in the server code. But in
PostgreSQL, the emphasis has shifted to augmenting features and capabilities, although
work continued in all areas. Enhancements incorporated in PostgreSQL are:

 Table-level locking has been replaced with multi-version concurrency control and
this allows users to continue reading consistent data during writer activity and
enables hot backups from pg_dump while the database stays available for queries.
 Some backend features such as sub-selects, defaults, constraints, and triggers, have
been implemented.
 Additional SQL92-compliant language features have been added, including
primary keys, quoted identifiers, literal string type coercion (this is used to convert
literal strings into appropriate values), type casting, etc.
 Built-in types have been improved, including new wide-range date/time types and
additional geometric type support.
 Overall backend code speed has been increased by approximately 20-40% and
backend start-up time has decreased 80% since version 6.0 was released.
Q5.

a. Define Indices. Explain different Index types.


Ans: Indices are a special type of database object. The use of Indices will greatly
increase database performance and also it enables faster execution of statements
involving comparative criteria. An index helps to find the targeted rows more efficiently
by tracking the data on one or more columns in a table. In this section we are going to
discuss the different types of indices available, and when we can use one type over the
other. Indices are used to access frequently used columns in a table.
We can create an index using the SQL command CREATE INDEX. The syntax of this
command is given below:
CREATE [UNIQUE] INDEX Index name ON table
[USINGindextype](Column[opclass][, ...] );
Here, Index name and table are the names of the new index and table name respectively,
and the column indicates the name of the column to be indexed. Here, we can list
multiple names separated by commas. The class parameter is used to indicate which
operator class is used in sorting input values. Consider an example:
CREATE INDEX book_index ON Books (title);
Here, we are creating an index on the table Books and we are using the column title as
the index.
We can create an index implicitly by the creation of primary key and unique key
constraints.
The UNIQUE keyword will disallow the index to take duplicate values within the
column it indexes. The creation of a UNIQUE index on a table and creating a table with
the UNIQUE constraint are functionally similar. One example is given below:
CREATE UNIQUE INDEX book_index ON Books (title);

INDEX Types
There are mainly three types of indices. The type of the index can be specified by a
USING clause which is optional. Three indices are,
 B-tree
 R-tree
 Hash
In this, B-tree implementation is the default index type. This is known as both the most
capable, and commonly used indexing method. R tree is a data structure used for spatial
access methods. Hash trees allow efficient and secure verification of the contents of
larger data structures. The USING clause can be used with the keywords BTREE,
RTREE, and HASH to explicitly choose the type of index to need to create. Specifying
BTREE explicitly chooses the default index type.
b. Describe the creation of new operators in PostgreSQL.
Ans: In PostgreSQL, we can create custom operators. These are sometimes called
syntactic sugar for functions because an operator act as an alternate syntax for an
existing function. The CREATE OPERATOR SQL command creates a new operator.
The syntax is given below,
CREATE OPERATOR name (PROCEDURE = functionname [, LEFTARG = type1]
[, RIGHTARG = type2]
[, COMMUTATOR = commutatorop] [, NEGATOR = negatorop]
[, RESTRICT = restrictproc]
[, JOIN = joinproc]
[, HASHES]
[, SORT1 = leftsortop]
[, SORT2 = rightsortop])

In the above syntax, the name is the new operator name; functionname is the name of
the func- tion which is called by an operator. The remaining clauses are optional; the
LEFTARG data type creates an operator that operates only on a value to its left and the
RIGHTARG data type operates on the value to its right. For binary operators, both must
be defined.
Example:
The following example creates an operator named *#, which passes the value to its left to the
isempty () function. Isempty () procedure returns the rows which have empty (zero) values for
the given parameter. Suppose the parameter given is stock value then this procedure returns
the rows which have stock value zero.
CREATE OPERATOR *# (PROCEDURE = isempty,
LEFTARG = integer);
The following query shows the use of the new *# operator to check for books that are out of
stock in ‘Stock item’ table in which ‘stock value’ attribute returns the number of items
available.
SELECT * FROM Stockitem WHERE stockvalue*#;
Q6.

a. Explain different data types used in PHP.


Ans: PHP has a total of eight data types that can be used to construct variables. They are,

1) Integers
2) Doubles
3) Booleans
4) NULL
5) Strings
6) Arrays
7) Objects
8) Resources.
In the above types, t he first five are simple types and the next two (arrays and
objects)
are compound.

1) Integers
Integers are whole numbers without a decimal point. They are the simplest
types. They can be either positive or negative. We can declare a variable like,
$ int_var = 3456;
$ a =-567
Integers can be in decimal (base 10), hexadecimal (base 16), and octal (base 8)
format. this decimal is the default format. Hexadecimal can be represented as
0X and octal integers with a leading 0.

2) Doubles
These are numbers with a floating-point like 3.145 or 52.3. we can declare a
double
number as
$ dou_var = 5.554;
$ b = 8.167

3) Boolean
The Boolean type can have only two possible values. They are TRUE or
FALSE. PHP
Provides a couple of constants TRUE or FALSE for use as Booleans. For
example,
If (TRUE)
Print (“this is true statements”); Else
Print (“this is false statements”);
We can interpret other statements as Booleans. If a value is a number, if it is
false, it is exactly equal to zero and true otherwise. If a string is empty, then it
is false and
Otherwise true. Values of type NULL are always false. If the variable is an array
and it contains no values then it is false otherwise it is true. Valid resources in
which if a
function can return that resource then it is true, otherwise it is false. We can’t
use double as Booleans.
4) NULL
NULL is a special type that only has one value that is NULL. To give a variable
NULL value, we can declare like,
&sample = NULL;

5) Strings
Strings are sequences of characters. We can declare a string like,
$string1= “this is an example string”;
In a string, the escape sequence replacements are,
\n – is replaced by the newline character
\r – is replaced by the carriage-return character
\t – is replaced by the tab character
\$ – is replaced by the dollar sign
\” – is replaced by the single double-quote
\\ – is replaced by the single backslash

6) Arrays
The array is a special variable that can store multiple values of the same type.
There
are 3 types of arrays that can be used. They are, Indexed arrays -Arrays with
numeric
index, Associative arrays - Arrays with named keys, and Multidimensional
arrays -
Arrays containing one or more arrays.
For example, consider the array given below.
$colors= array (“red”,”green”,”blue”);
And each color can access using index. That is,
$colors[0] = “red”;
$colors[1]=”green”;
$colors[2]=”blue”;

7) Objects
Another variable type is an object. We can create an object using the keyword
‘new’. Consider the example,
<?php? Class AB
{
Function display ()
{
Print “doing example”;
}
}
$a1= new AB;
$a1->display ();
?>
8) Resources
The resource is a special variable holding a reference to an external variable or
resource. A resource with no more references to it will delete automatically
b. Describe about Join algorithm in Berkeley DB.
Ans: The join algorithm inside Berkeley DB is not used in the table handler.
MySQL executes the queries and processes the results using the table handlers
only as data retrieval and storage systems. The joining conventions of Berkeley
DB are presented here; these are not used in MySQL.
BDB supports natural joins on secondary indexes. All the data is stored as
key/value pairs. The primary table has a primary key and a value of some type.
The secondary index consists of the secondary key/value of primary key pairs.
The join can be used to retrieve records from the primary table based on a
secondary index.
Joining two primary tables is not possible. Several secondary indexes can be
used in one join; each has primary keys of the primary table as values. However,
secondary indexes cannot be joined to each other; they can only be used to
retrieve records from the primary table. To perform a join the application
programmer retrieves the desired values from each secondary index involved.
The secondary index values are looped through to find all common primary
index keys, which are used to retrieve the desired values. The secondary index
looping is a modified version of the indexed nested loop.

You might also like