SlideShare uma empresa Scribd logo
1 de 10
Data Structures & Database
Database Engine
Search Algorithms
Binary Trees
B-Trees
Indexes
Database Engine
         Bike Engine (With Gears)                       Database Engine

Start your bike engine                     Start your database engine.
                                           Create database objects and run
Change gears to 1st and drive the bike.
                                           applications.
What happens to bike engine if we don’t    What happens if we don’t changes gears
change gears?                              in database? Gears in database???
I need to go fast now.                     I need to get fast results.
You change gears the from 1st to 2nd and   Change gears of a database engine.
3rd as you would like to go fast.          ???  don’t have gears in database.
                                                We
Dead Engine                               Very slow and dead applications. 

Root cause: Bad bike rider - User          Root cause: Poor database user.
Search Algorithms
Let’s go through 2 Algorithms
• Sequential Search
• Binary Search

Database Plans
• Scans
• Seeks
Sequential Search
Linear search or Sequential search is a method for finding a
particular value in a list, that consists of checking every one of
its elements, one at a time and in sequence, until the desired
one is found.
Set i to 1.
Repeat this loop:
       If i > n, then exit the loop.
       If A[i] = x, then exit the loop.
Set i to i + 1.
Return i.
Binary Search
•   Binary Search or Half-interval search algorithm locates the position of an item in a
    sortedarray.Binary search works by comparing an input value to the middle
    element of the array. The comparison determines whether the element equals the
    input, less than the input or greater. When the element being compared to equals
    the input the search stops and typically returns the position of the element. If the
    element is not equal to the input then a comparison is made to determine
    whether the input is less than or greater than the element. Depending on which it
    is the algorithm then starts over but only searching the top or bottom subset of
    the array's elements. If the input is not located within the array the algorithm will
    usually output a unique value indicating this.
Binary Trees
• A binary tree is a tree data structure in which each node has at most
  two child nodes, usually distinguished as "left" and "right". Nodes with
  children are parent nodes, and child nodes may contain references to their
  parents. Outside the tree, there is often a reference to the "root" node
  (the ancestor of all nodes), if it exists. Any node in the data structure can
  be reached by starting at root node and repeatedly following references to
  either the left or right child.
B-Trees
B-tree is a tree data structure that keeps data sorted and allows
searches, sequential access, insertions, and deletions. The B-tree is a
generalization of a binary search tree in that a node can have more than
two children. Unlike self-balancing binary search trees, the B-tree is
optimized for systems that read and write large blocks of data. It is
commonly used in databases and filesystems.
B-Trees
Index (Database)
A database index is a data structure that improves the speed of data
retrieval operations on a database table at the cost of slower writes and
increased storage space. Indexes can be created using one or
more columns of a database table, providing the basis for both rapid
random lookups and efficient access of ordered records. The disk space
required to store the index is typically less than that required by the table
(since indexes usually contain only the key-fields according to which the
table is to be arranged, and exclude all the other details in the
table), yielding the possibility to store indexes in memory for a table
whose data is too large to store in memory.
Questions?

Mais conteúdo relacionado

Mais procurados

Data Structure # vpmp polytechnic
Data Structure # vpmp polytechnicData Structure # vpmp polytechnic
Data Structure # vpmp polytechniclavparmar007
 
Introduction To Data Structures
Introduction To Data StructuresIntroduction To Data Structures
Introduction To Data StructuresSpotle.ai
 
Elementary data organisation
Elementary data organisationElementary data organisation
Elementary data organisationMuzamil Hussain
 
Introduction To Data Structures.
Introduction To Data Structures.Introduction To Data Structures.
Introduction To Data Structures.Education Front
 
introduction to Data Structure and classification
 introduction to Data Structure and classification introduction to Data Structure and classification
introduction to Data Structure and classificationchauhankapil
 
Digital Science Resources Jan 2017
Digital Science Resources Jan 2017Digital Science Resources Jan 2017
Digital Science Resources Jan 2017mrskohs
 
Chapter 1( intro & overview)
Chapter 1( intro & overview)Chapter 1( intro & overview)
Chapter 1( intro & overview)MUHAMMAD AAMIR
 
"UConn Conversations" course research
"UConn Conversations" course research "UConn Conversations" course research
"UConn Conversations" course research mrskohs
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsAakash deep Singhal
 
Spanish 2 Presentation
Spanish 2 PresentationSpanish 2 Presentation
Spanish 2 Presentationmrskohs
 

Mais procurados (20)

Tree
TreeTree
Tree
 
Cap233 dbase retrieval
Cap233 dbase retrievalCap233 dbase retrieval
Cap233 dbase retrieval
 
Programming with matlab session 2
Programming with matlab session 2Programming with matlab session 2
Programming with matlab session 2
 
Data Structure # vpmp polytechnic
Data Structure # vpmp polytechnicData Structure # vpmp polytechnic
Data Structure # vpmp polytechnic
 
Introduction To Data Structures
Introduction To Data StructuresIntroduction To Data Structures
Introduction To Data Structures
 
Data structures
Data structuresData structures
Data structures
 
Data struters
Data strutersData struters
Data struters
 
Elementary data organisation
Elementary data organisationElementary data organisation
Elementary data organisation
 
Data structures notes
Data structures notesData structures notes
Data structures notes
 
Struktur data ppt
Struktur data pptStruktur data ppt
Struktur data ppt
 
Introduction To Data Structures.
Introduction To Data Structures.Introduction To Data Structures.
Introduction To Data Structures.
 
introduction to Data Structure and classification
 introduction to Data Structure and classification introduction to Data Structure and classification
introduction to Data Structure and classification
 
Digital Science Resources Jan 2017
Digital Science Resources Jan 2017Digital Science Resources Jan 2017
Digital Science Resources Jan 2017
 
Chapter 1( intro & overview)
Chapter 1( intro & overview)Chapter 1( intro & overview)
Chapter 1( intro & overview)
 
"UConn Conversations" course research
"UConn Conversations" course research "UConn Conversations" course research
"UConn Conversations" course research
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithms
 
Binary search tree
Binary search treeBinary search tree
Binary search tree
 
Spanish 2 Presentation
Spanish 2 PresentationSpanish 2 Presentation
Spanish 2 Presentation
 
Linear Search Presentation
Linear Search PresentationLinear Search Presentation
Linear Search Presentation
 
Lecture1 data structure(introduction)
Lecture1 data structure(introduction)Lecture1 data structure(introduction)
Lecture1 data structure(introduction)
 

Destaque

BTree, Data Structures
BTree, Data StructuresBTree, Data Structures
BTree, Data StructuresJibrael Jos
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data StructureAnuj Modi
 
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMSkoolkampus
 
9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patil9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patilwidespreadpromotion
 

Destaque (10)

Nikhat b+ trees ppt
Nikhat b+ trees pptNikhat b+ trees ppt
Nikhat b+ trees ppt
 
B+ trees
B+ treesB+ trees
B+ trees
 
B tree short
B tree shortB tree short
B tree short
 
B+ Tree
B+ TreeB+ Tree
B+ Tree
 
BTree, Data Structures
BTree, Data StructuresBTree, Data Structures
BTree, Data Structures
 
B tree
B treeB tree
B tree
 
b+ tree
b+ treeb+ tree
b+ tree
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data Structure
 
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS
 
9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patil9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patil
 

Semelhante a Database Engine

Data Structure & Algorithms - Operations
Data Structure & Algorithms - OperationsData Structure & Algorithms - Operations
Data Structure & Algorithms - Operationsbabuk110
 
Lecture 2 Data Structure Introduction
Lecture 2 Data Structure IntroductionLecture 2 Data Structure Introduction
Lecture 2 Data Structure IntroductionAbirami A
 
Introduction to data structures (ss)
Introduction to data structures (ss)Introduction to data structures (ss)
Introduction to data structures (ss)Madishetty Prathibha
 
Introduction of Data Structure
Introduction of Data StructureIntroduction of Data Structure
Introduction of Data StructureMandavi Classes
 
Binary Search Tree In Python.pptx
Binary Search Tree In Python.pptxBinary Search Tree In Python.pptx
Binary Search Tree In Python.pptxRohanThota3
 
SORTING techniques.pptx
SORTING techniques.pptxSORTING techniques.pptx
SORTING techniques.pptxDr.Shweta
 
PPT_DATA STRUCTURE.ppt
PPT_DATA STRUCTURE.pptPPT_DATA STRUCTURE.ppt
PPT_DATA STRUCTURE.pptYAZATMishra
 
Circular Linked List.pptx
Circular Linked List.pptxCircular Linked List.pptx
Circular Linked List.pptxkasthurimukila
 
09c-DataStructuresListsArrays.ppt
09c-DataStructuresListsArrays.ppt09c-DataStructuresListsArrays.ppt
09c-DataStructuresListsArrays.pptNagarajuNaveena1
 
Data Structures
Data StructuresData Structures
Data Structureshmwwfv1
 
09c-DataStructuresListsArrays.ppt
09c-DataStructuresListsArrays.ppt09c-DataStructuresListsArrays.ppt
09c-DataStructuresListsArrays.pptMeenakshiPatel13
 
dotnetMALAGA - Sql query tuning guidelines
dotnetMALAGA - Sql query tuning guidelinesdotnetMALAGA - Sql query tuning guidelines
dotnetMALAGA - Sql query tuning guidelinesJavier García Magna
 
Binary search tree operations
Binary search tree operationsBinary search tree operations
Binary search tree operationsKamran Zafar
 
Ch 8 introduction to data structures
Ch 8 introduction to data structuresCh 8 introduction to data structures
Ch 8 introduction to data structuresChaffey College
 

Semelhante a Database Engine (20)

Data Structure & Algorithms - Operations
Data Structure & Algorithms - OperationsData Structure & Algorithms - Operations
Data Structure & Algorithms - Operations
 
Lecture 2 Data Structure Introduction
Lecture 2 Data Structure IntroductionLecture 2 Data Structure Introduction
Lecture 2 Data Structure Introduction
 
Introduction to data structures (ss)
Introduction to data structures (ss)Introduction to data structures (ss)
Introduction to data structures (ss)
 
Introduction of Data Structure
Introduction of Data StructureIntroduction of Data Structure
Introduction of Data Structure
 
Binary Search Tree In Python.pptx
Binary Search Tree In Python.pptxBinary Search Tree In Python.pptx
Binary Search Tree In Python.pptx
 
SORTING techniques.pptx
SORTING techniques.pptxSORTING techniques.pptx
SORTING techniques.pptx
 
PPT_DATA STRUCTURE.ppt
PPT_DATA STRUCTURE.pptPPT_DATA STRUCTURE.ppt
PPT_DATA STRUCTURE.ppt
 
Circular Linked List.pptx
Circular Linked List.pptxCircular Linked List.pptx
Circular Linked List.pptx
 
09c-DataStructuresListsArrays.ppt
09c-DataStructuresListsArrays.ppt09c-DataStructuresListsArrays.ppt
09c-DataStructuresListsArrays.ppt
 
Data Structures
Data StructuresData Structures
Data Structures
 
09c-DataStructuresListsArrays.ppt
09c-DataStructuresListsArrays.ppt09c-DataStructuresListsArrays.ppt
09c-DataStructuresListsArrays.ppt
 
Ch1
Ch1Ch1
Ch1
 
Unit08 dbms
Unit08 dbmsUnit08 dbms
Unit08 dbms
 
dsa.pptx
dsa.pptxdsa.pptx
dsa.pptx
 
Binary search
Binary search Binary search
Binary search
 
dotnetMALAGA - Sql query tuning guidelines
dotnetMALAGA - Sql query tuning guidelinesdotnetMALAGA - Sql query tuning guidelines
dotnetMALAGA - Sql query tuning guidelines
 
Indexing and hashing
Indexing and hashingIndexing and hashing
Indexing and hashing
 
Binary search tree operations
Binary search tree operationsBinary search tree operations
Binary search tree operations
 
Ch 8 introduction to data structures
Ch 8 introduction to data structuresCh 8 introduction to data structures
Ch 8 introduction to data structures
 
binary search tree
binary search treebinary search tree
binary search tree
 

Database Engine

  • 1. Data Structures & Database Database Engine Search Algorithms Binary Trees B-Trees Indexes
  • 2. Database Engine Bike Engine (With Gears) Database Engine Start your bike engine Start your database engine. Create database objects and run Change gears to 1st and drive the bike. applications. What happens to bike engine if we don’t What happens if we don’t changes gears change gears? in database? Gears in database??? I need to go fast now. I need to get fast results. You change gears the from 1st to 2nd and Change gears of a database engine. 3rd as you would like to go fast. ???  don’t have gears in database. We Dead Engine  Very slow and dead applications.  Root cause: Bad bike rider - User Root cause: Poor database user.
  • 3. Search Algorithms Let’s go through 2 Algorithms • Sequential Search • Binary Search Database Plans • Scans • Seeks
  • 4. Sequential Search Linear search or Sequential search is a method for finding a particular value in a list, that consists of checking every one of its elements, one at a time and in sequence, until the desired one is found. Set i to 1. Repeat this loop: If i > n, then exit the loop. If A[i] = x, then exit the loop. Set i to i + 1. Return i.
  • 5. Binary Search • Binary Search or Half-interval search algorithm locates the position of an item in a sortedarray.Binary search works by comparing an input value to the middle element of the array. The comparison determines whether the element equals the input, less than the input or greater. When the element being compared to equals the input the search stops and typically returns the position of the element. If the element is not equal to the input then a comparison is made to determine whether the input is less than or greater than the element. Depending on which it is the algorithm then starts over but only searching the top or bottom subset of the array's elements. If the input is not located within the array the algorithm will usually output a unique value indicating this.
  • 6. Binary Trees • A binary tree is a tree data structure in which each node has at most two child nodes, usually distinguished as "left" and "right". Nodes with children are parent nodes, and child nodes may contain references to their parents. Outside the tree, there is often a reference to the "root" node (the ancestor of all nodes), if it exists. Any node in the data structure can be reached by starting at root node and repeatedly following references to either the left or right child.
  • 7. B-Trees B-tree is a tree data structure that keeps data sorted and allows searches, sequential access, insertions, and deletions. The B-tree is a generalization of a binary search tree in that a node can have more than two children. Unlike self-balancing binary search trees, the B-tree is optimized for systems that read and write large blocks of data. It is commonly used in databases and filesystems.
  • 9. Index (Database) A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of slower writes and increased storage space. Indexes can be created using one or more columns of a database table, providing the basis for both rapid random lookups and efficient access of ordered records. The disk space required to store the index is typically less than that required by the table (since indexes usually contain only the key-fields according to which the table is to be arranged, and exclude all the other details in the table), yielding the possibility to store indexes in memory for a table whose data is too large to store in memory.