Lets say I have a global dataset and I run queries over those data set.For example my dataset would be#id, #Name, #Employee, #Birthdate, #number_of_children1, Nick, Nasa, 1982, 12, Jack, Exon, 1985, 53, Tom, ABCD, 1978, 0And I can run queryies on those dataset.sample queries would be* #Query => #Result_ids * (Name starts with A) => [1]* (Birthdate before 1983 and have children ) => [1]I want to store those queries on a data structure and I want to be able to do set operations on those queries like intersection and union. So an example union operation would be.(Birthdate before 1983) intersection (have children) => (Birthdate before 1983 and have children)I also want to be able to findout if one query is subset or superset of another one. For example.(Birthdate before 1983) is superset of (Birthdate before 1980)(Have 3 children) is subset of (Have more than 1 children)(Name = Jack and born in 1980) is subset of (Born before 1990)I will have a program that will have thousands of queries. And it will combine those queries to make more variety of queries. When I have a new query, I will compare it with existing queries to see if I have an exact query in store or have a superset.Can anybody suggest me a data structure that is fast enough to store and operate on those data?
Algorithm for query comparison
databases;data sets