Question: I understand from my recent use of PHP-PDO over the last few months that you can do a PREPARE statement and then run the query. In fact I can see the usefulness of this if I'm going to either SELECT on a complex join, varying the where conditions, a repeated number of times.

Or, similarly, if I was wanting to insert multiple records.

However, if I know I only want to run a statement once, shouldn't I just EXECUTE the query? I'm basically querying the database twice.

Answer: 
```
extension Array where Element: Hashable {
    var setValue: Set<Element> {
        return Set<Element>(self)
    }
}

let numbers = [1,2,3,4,5,6,7,8,9,0,0,9,8,7]
let uniqueNumbers = numbers.setValue    // {0, 2, 4, 9, 5, 6, 7, 3, 1, 8}

let names = ["John","Mary","Steve","Mary"]
let uniqueNames = names.setValue    // {"John", "Mary", "Steve"}

```
So I think creating a Set with an array is a terrible idea - O(n) is the time complexity of that set. 

I have put together a nice Set that uses a dictionary: <https://github.com/evilpenguin/Swift-Stuff/blob/master/Set.swift>