Re: Arrays vs separate tables
| От | Ray O'Donnell |
|---|---|
| Тема | Re: Arrays vs separate tables |
| Дата | |
| Msg-id | 01020199fe3f6030-5d953b42-e08d-4782-9da3-3d635f5445af-000000@eu-west-1.amazonses.com обсуждение исходный текст |
| Ответ на | Arrays vs separate tables (Rich Shepard <rshepard@appl-ecosys.com>) |
| Ответы |
Re: Arrays vs separate tables
|
| Список | pgsql-general |
On 19/10/2025 21:43, Rich Shepard wrote: > In the former book I read that sometimes it's better to have multiple > values > for an atribute in a single row by creating a separate table for that > attribute rather than using the postgres array capability. The people > table > in my database (1706 rows) has two attributes using the array type > (direct_phone and email), and only a few indivuals have multiple landline > phone numbers (cell_phone is a separate column) or email addresses > (office > and personal?). Would it make sense for me to create new landline and > email > address tables and replace the array contents? > My experience of doing something similar was that arrays work very well for the use-case you describe, as long as you don't have to search inside the arrays... I found that, if you have to search for a specific value inside an array, then performance really goes out the window. Mind you, clever use of an index would probably help here. Ray. -- Ray O'Donnell // Galway // Ireland ray@rodonnell.ie
В списке pgsql-general по дате отправления: