SimpleDB does not support the concept of joins. Instead, SimpleDB provides you with the ability to store multiple values for an attribute, thus avoiding the necessity to perform a join to retrieve all the values.
ID | |||
---|---|---|---|
101 |
First_Name=John |
Last_Name=Smith |
Phone_Num = 555-845-7854 Phone_Num = 555-854-9885 Phone_Num = 555-695-7485 |
102 |
First_Name=Bill |
Last_Name=Jones |
Phone_Num = 555-748-7854 Phone_Num = 555-874-8654 |
In the SimpleDB table, each record is stored as an item with attribute/value pairs. The difference here is that the Phone_Num
field has multiple values. Unlike a delimited list field, SimpleDB indexes all values enabling an efficient search each value.
SELECT * FROM Contact_Info WHERE Phone_Num = '555-854-9885'
This SELECT
is very quick and efficient. It is even possible to use Phone_Num
multiple times such as follows:
SELECT * FROM Contact_Info WHERE Phone_Num = '555-854-9885' OR Phone_Num = '555-748-7854'
Let's analyze the strengths and weaknesses of this approach...