| "To access an element in an array" I guess that's the thing: why would you want to access array elements? What business problem is that solving? "there is a condition there if you want to reference by index which is the primary point of arrays" In this example, he's using an array more like a set. I don't think he intends for a tag at index 17 to mean something different than a tag of the same value at index 3. I agree that postgresql should probably have a good "set" datatype, but at this time it does not and arrays are a reasonable way to implement sets in a lot of cases. For instance, GIN allows fast searches on queries like "find the arrays that contain element 'X'". That's more like a set operation. "The optimiser will most likely be better at retrieving and caching data based on a join condition versus column contents." There are probably some cases where it's better and some where it's worse. Postgres does keep track of stats for array elements in addition to the arrays themselves, so it's not obvious to me that using a separate table would improve matters. |