- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Explain the algorithm to check lossy or lossless decomposition

Decomposition is said to be **lossy**, if it is impossible to reconstruct the original table from the decomposed tables without loss of information.

Decomposition is said to be **lossless**, if it is possible to reconstruct the original table by using a natural join without any loss of information.

## Algorithm

Given below is an algorithm to check if decomposition is lossy or lossless −

**Step 1**− Create a table with M rows and N columnsM= number of decomposed relations.

N= number of attributes of original relation.

**Step 2**− If a decomposed relation Ri has attribute A thenInsert a symbol (say ‘a’) at position (Ri,A)

**Step 3**− Consider each FD X->YIf column X has two or more symbols then

Insert symbols in the same place (rows) of column Y.

**Step 4**− If any row is completely filled with symbols thenDecomposition is lossless.

Else

Decomposition is lossy.

## Problem

Consider an example to check whether the given relation can be decomposed with lossy or lossless by applying the above algorithm.

Consider R(A,B,C,D,E)

F:{A->B, BC->E, ED->A}

R is decomposed into R1(AB) and R2(ACDE). Check the decomposition is lossy or lossless.

## Solution

Follow the steps given below to determine whether the given decomposition is lossless or lossy −

**Step 1**

**Step 2**

**Step 3**

Now let us insert symbol ‘a’ for A->B in second column, second row

R2 is completely filled => decomposition is lossless.

- Related Questions & Answers
- Lossless and Lossy Decomposition in DBMS
- Difference between Lossy Compression and Lossless Compression
- What is lossless join decomposition in DBMS?
- How does the Lossy Counting algorithm find frequent items?
- Explain about CYK Algorithm for Context Free Grammar
- What is Decomposition in DBMS?
- Return the Cholesky decomposition in Linear Algebra in Python
- Longest Chunked Palindrome Decomposition in python
- What is Bias–Variance Decomposition?
- Explain in detail about Mark and Sweep algorithm in JavaScript?
- Explain check pointing in the transaction management system(DBMS)
- C++ Program to Perform LU Decomposition of any Matrix
- Explain how Nelder-Mead algorithm can be implemented using SciPy Python?
- The MySQL EXPLAIN keyword executes the query or just explains the query?
- Program to find minimum length of lossy Run-Length Encoding in Python