raising the default prepareTheshold
От | Oliver Jowett |
---|---|
Тема | raising the default prepareTheshold |
Дата | |
Msg-id | 414CA8A0.7070707@opencloud.com обсуждение исходный текст |
Ответы |
Re: raising the default prepareTheshold
Re: raising the default prepareTheshold |
Список | pgsql-jdbc |
I'd like to raise the default prepareThreshold to some non-zero value, perhaps 5 or so. This means that PreparedStatements that are used more than 5 times will allocate and use a named backend statement. Usually, using a named statement is a performance win as it avoids reparsing and replanning the query on each execution; I've seen measurable improvement (at least 15%, from memory) on heavily-reused simple queries where the parse/plan cost is a noticable fraction of total execution time. However, with a 8.0 backend, if the planner benefits from knowing the particular parameter values in use for a particular query, then using an unnamed statement may be faster due to using an improved plan. Under 7.4 there will be no difference; both named and unnamed statements will use the generic plan. So using named statements always by default (default prepareThreshold = 1) probably isn't a good idea. Using a default prepareThreshold > 1 seems like a reasonable compromise. What does everyone think? -O
В списке pgsql-jdbc по дате отправления: