arrays vs. columns
От | Mark Nelson |
---|---|
Тема | arrays vs. columns |
Дата | |
Msg-id | 01KPA3RXIMKY91X18G@cc.usu.edu обсуждение исходный текст |
Ответы |
Re: arrays vs. columns
|
Список | pgsql-novice |
Hi, I'm wondering about the efficiency of using an array in a single cell vs. making a table with lots of columns (like 50-70). Here's what I'm doing. I'm working on an application where a user goes through a program that has between 50 and 70 pages and it is critical to know which pages the user has been to, and how many times. Something of an accurate counter, but one that can distinguish between users. So each time a user goes to a page, a number is incremented for that user on that page. I could either make a table with columns for each individual page and when the user hits the page, it sends the query to the table incrementing the field for that user, or I could have a table where there is one column that holds an array with all the pages and their related counts. The second option means I would be updating that one cell for each page visited. But I seem to have read somewhere that if you are going to make lots of updates to an array, it is better to put the array items in their own columns. Anybody have any advice? /mark
В списке pgsql-novice по дате отправления: