Re: [noob] How to optimize this double pivot query?
От | Thomas Kellerer |
---|---|
Тема | Re: [noob] How to optimize this double pivot query? |
Дата | |
Msg-id | k4e2j6$hc2$1@ger.gmane.org обсуждение исходный текст |
Ответ на | Re: [noob] How to optimize this double pivot query? (Robert Buck <buck.robert.j@gmail.com>) |
Ответы |
Re: [noob] How to optimize this double pivot query?
|
Список | pgsql-sql |
Robert Buck, 02.10.2012 03:13: > So as you can probably glean, the tables store performance metric > data. The reason I chose to use k-v is simply to avoid having to > create an additional column every time a new metric type come along. > So those were the two options I thought of, straight k-v and column > for every value type. > > Are there other better options worth considering that you could point > me towards that supports storing metrics viz. with an unbounded > number of metric types in my case? > Have a look at the hstore module. It's exactly meant for that scenario with the added benefit that you can index on that column and looking up key names and their values is blazingly fast then. That combined with the tablefunc module (which let's you do pivot queries) might make your queries substantially more readable (and maybe faster as well). Regards Thomas
В списке pgsql-sql по дате отправления: