*Input*:* $R\left({A}_{i},{A}_{2},\cdots ,{A}_{m}\right)$ *:* The relation*;* $Q=\left\{{Q}_{1},{Q}_{2},\cdots ,{Q}_{n}\right\}$ *:* The set of user queries that will run on R*;* cut-off*:* Cut-off Average Similarity *. *Output*:* C*:* The set of materialized views*. *Step *1:* Construct the m** *×* **n** Attribute Usage Matrix where m is the number of attributes and n is the number of queries*. *Step *2:* Construct the n** *×* **n** Attribute Similarity Matrix from the Attribute Usage Matrix*. /** In step *3* the Graphs & the corresponding clusters are constructed **/ *Step *3: *∀** *(*A*_{i}, A_{j})* *∈* Attribute Similarity Matrix, identify the attribute pair similarity ** **values so that J *(*A*_{i}, A_{j})* *≥* cut-off*. *Store these values in a list L in descending order*. *Store the number of elements in L into a variable count*. *a*)* If count** *=* *0* then go to step *5.* */** The algorithm fails to draw any graph*.* Therefore, no materialized view can be constructed **/ *b*)* If count *>* *0* then Repeat until list L is empty* *i*)* **Pop the ith *(1* *≤ *I** *≤* count*)* element from L*.* Store the value of the element into ** **avariable** x *(0* *≤* x *≤* *1). *ii*) *∀** Attribute pairs *(*A*_{i}, A_{j})* *∈* Attribute Similarity Matrix* *If J *(*A*_{i}, A_{j})* *=* x, then G*_{i}* *← *G*_{i}* *∪* A*_{i} ∪* **A*_{j}* */** Pair of attributes is inserted* *in G*_{i}, where G_{i} represents the i^{th} graph for i^{th} highest similarity value.* **/ *iii*)* C*_{i}←* G*_{i} /**C*_{i} *represents the i*^{th} cluster for i^{th} highest similarity value.* **/ *iv*)* C *←* C *∪* C*_{i} /** Each cluster C*_{i} is added to the set of clusters C */ /** In step *4* the clusters are validated and materialized views are formed**/ *Step *4:* **∀** C*_{i} ∈* C, Calculate *(*C*_{i})_{avg}* by equation*: ${\left({C}_{i}\right)}_{avg}=\frac{{\displaystyle {\sum}_{i=1}^{\left(\begin{array}{c}n\\ 2\end{array}\right)}J\left({A}_{i};{A}_{j}\right)}}{\left(\begin{array}{c}n\\ 2\end{array}\right)}$ *where i # j* *If *((*C*_{i})_{avg} <* cut-off then C *←* C *−* C*_{i} /** C represents the set of materialized views where each cluster C*_{i} represents a valid * **materialized view **/ *Step *5:* End*.* * |