diff --git a/complexity b/complexity index d6cec86..48fadab 100644 --- a/complexity +++ b/complexity @@ -15,6 +15,10 @@ Notation Single letters will be used to indicate relations and letters between | will indicate the cardinality (number of tuples) of the relation. + + Then after evaluating the big O notation, an attempt to find more + precise results will be done, since it will be important to know + with a certain precision the weight of the operation. 1. UNARY OPERATORS @@ -41,8 +45,24 @@ Notation In the end we have O(|n|) as complexity for a selection on the relation n. + + The assumption made of considering constant the number of fields is + a bit strong. For example a relation could have hundreds of fields + and two tuples. + + So in general, the complexity is something more like O(|n| * f) where + f is the number of the fields. 1.2 Rename -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -1.3 Projection \ No newline at end of file + The rename operation itself is very simple, just modify the list + containing the name of the fields. + The big issue is to copy the content of the relation into a new + relation object, so the new one can be modified. + + So the operation depends on the size of the relation: O(|n| * f). + +1.3 Projection + + +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \ No newline at end of file