Dynamic queries in stored procedure

Поиск
Список
Период
Сортировка
От Greg Jaskiewicz
Тема Dynamic queries in stored procedure
Дата
Msg-id 96F5E9DF-8F6E-4EF6-B0AE-43B585B11F94@gmail.com
обсуждение исходный текст
Ответы Re: Dynamic queries in stored procedure  (Andrew Dunstan <andrew@dunslane.net>)
Re: Dynamic queries in stored procedure  (Misa Simic <misa.simic@gmail.com>)
Список pgsql-performance
Hey,

We have a search method that depending on search params will join 3-5 tables, craft the joins and where section. Only
problemis, this is done in rather horrible java code. So using pgtap for tests is not feasible. 
I want to move the database complexity back to database, almost writing the query construction in the plpgsql or python
asstores procedure, any suggestions ? 

Unfortunately PostgreSQL won't eliminate unnecessary joins from a view, so I can't just create one view and simple code
addingwhere's, order by, etc. 

No, I don't want to use orm.

Thanks.




В списке pgsql-performance по дате отправления:

Предыдущее
От: David Johnston
Дата:
Сообщение: Re: My changes in the postgresql.conf does not work
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Dynamic queries in stored procedure