Re: query overhead
От | Tom Lane |
---|---|
Тема | Re: query overhead |
Дата | |
Msg-id | 3893.1342196107@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | query overhead (Andy Halsall <halsall_andy@hotmail.com>) |
Список | pgsql-performance |
Andy Halsall <halsall_andy@hotmail.com> writes: > I've written an Immutable stored procedure that takes no parameters and returns a fixed value to try and determine theround trip overhead of a query to PostgreSQL. Call to sp is made using libpq. We're all local and using UNIX domain sockets. > Client measures are suggesting ~150-200 microseconds to call sp and get the answer back That doesn't sound out of line for what you're doing, which appears to include parsing/planning a SELECT command. Some of that overhead could probably be avoided by using a prepared statement instead of a plain query. Or you could try using the "fast path" API (see libpq's PQfn) to invoke the function directly without any SQL query involved. Really, however, the way to make things fly is to get rid of the round trip overhead in the first place by migrating more of your application logic into the stored procedure. I realize that that might require pretty significant rewrites, but if you can't tolerate per-query overheads in the 100+ usec range, that's where you're going to end up. If you don't like any of those answers, maybe Postgres isn't the solution for you. You might consider an embeddable database such as SQLLite. regards, tom lane
В списке pgsql-performance по дате отправления: