Re: advice on how to store variable attributes
От | Linos |
---|---|
Тема | Re: advice on how to store variable attributes |
Дата | |
Msg-id | 4EA2F9DD.2040106@linos.es обсуждение исходный текст |
Ответ на | Re: advice on how to store variable attributes (David Johnston <polobo@yahoo.com>) |
Список | pgsql-sql |
El 22/10/11 18:10, David Johnston escribió: > > > SELECT ... > FROM vendor_invoices > JOIN ( SELECT ... FROM eav WHERE category = '' ) icm USING ( invoice_id ) > > Add a sub-query join for each desired category. > > I agree HStore looks cleaner for the query example you give. One apparent advantage is that since each record containsa single value you can use additional columns to store properties (e.g. Units) whereas the hstore makes that moredifficult - though not impossible - since the keys are bot naturally related to each other. > > From an output perspective hstore looks good. If there are no difficulties on the data input process you might as welljust go with it. Given your volume and use-case it really isn't going to matter which option you pick; though I'd suggestproviding views related to each major category with only the appropriate values and no access to the hstore column. > > David J. > > I will try with hstore and EAV both and see what seems more natural for me, i have to take account how easy/clean it is to work with both from the Qt application, i think eav would be much better to edit in a table. Thanks to all for the replies. Regards, Miguel Angel.
В списке pgsql-sql по дате отправления: