Re: [PERFORM] Bulk persistence strategy
От | Merlin Moncure |
---|---|
Тема | Re: [PERFORM] Bulk persistence strategy |
Дата | |
Msg-id | CAHyXU0xz9oGMoM26bc3-RbEb0wtMycrMzxos6wnpaB4jtKmAPw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [PERFORM] Bulk persistence strategy (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-performance |
On Sun, May 21, 2017 at 5:37 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Riaan Stander <rstander@exa.co.za> writes: >> The intended use is use-once. The reason is that the statements might >> differ per call, especially when we start doing updates. The ideal would >> be to just issue the sql statements, but I was trying to cut down on >> network calls. > > Hm, well, feeding data forward to the next query without a network > round trip is a valid concern. > > How stylized are these commands? Have you considered pushing the > generation logic into the function, so that you just have one (or > a few) persistent functions, and the variability slack is taken > up through EXECUTE'd strings? +1. If 'DO' could return a value and take arguments, we'd probably just use that. With the status quo however the SQL generation facilities need to be moved into the database as dynamic SQL (that is, executed with EXECUTE). This will provide the speed benefits while maintaining (albeit with some rethinking) your abstraction model Please make liberal use of quote_ident() and quote_literal() to minimize security risks. merlin
В списке pgsql-performance по дате отправления: