Re: Compare rows, SEMI-SUMMARY
От | Greg Spiegelberg |
---|---|
Тема | Re: Compare rows, SEMI-SUMMARY |
Дата | |
Msg-id | 3F85C190.6080108@cranel.com обсуждение исходный текст |
Ответ на | Re: Compare rows (Hannu Krosing <hannu@tm.ee>) |
Список | pgsql-performance |
Per Josh's recommendation to implement a Vertical Child Table I came up with 3 possible tables to handle the 3 possible value types: varchar, numeric and bigint. Each table has 7 columns: 1 to denote the time the data was collected, 4 which identify where the data came from, 1 to tell me the value name and the last being the value itself. OLD NEW tables 1 3 columns 642 7 each indexes ~1200 39 views 37 ? rows 1700-3000 30,000 query on table 0.01 sec 0.06 sec query on view 0.02 sec ? Not too bad. Guess there were a few 0's and NULL's out there, eh? 642 * 1,700 = 1,091,400 cells 3 * 7 * 30,000 = 630,000 cells 461,400 NULL's and 0's using the big 'ol table I can get around in this setup, however, I would appreciate some help in recreating my views. The views use to be there simply as an initial filter and to hide all the 0's and NULL's. If I can't do this I will be revisiting and testing possibly hundreds of programs and scripts. Any takers? Greg -- Greg Spiegelberg Sr. Product Development Engineer Cranel, Incorporated. Phone: 614.318.4314 Fax: 614.431.8388 Email: gspiegelberg@Cranel.com Cranel. Technology. Integrity. Focus.
В списке pgsql-performance по дате отправления: