Re: BUG: endless lseek(.., SEEK_END) from select queries on x64 builds

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: BUG: endless lseek(.., SEEK_END) from select queries on x64 builds
Дата
Msg-id 5128E632.2040209@vmware.com
обсуждение исходный текст
Ответ на Re: BUG: endless lseek(.., SEEK_END) from select queries on x64 builds  (Markus Schulz <msc@antzsystem.de>)
Ответы Re: BUG: endless lseek(.., SEEK_END) from select queries on x64 builds  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
On 22.02.2013 20:10, Markus Schulz wrote:
> Am Freitag, 22. Februar 2013, 14:35:25 schrieb Heikki Linnakangas:
>> You could check what the generic plan looks like by taking the query
>> used in the java program, with the parameter markers, and running
>> EXPLAIN on that.
>
> how can i do this?
> I've tried the following in my ejb-test-function to:
>
> String query = "..."
> entitymanager.createNativeQuery(query)...;
> entitymanager.createNativeQuery("EXPLAIN ANALYZE " + query)...;
>
> but the second createNativeQuery call runs fast every time and will show the
> same plan and the first hangs after the fourth call to this function.

You can take the query, replace the ? parameter markers with $1, $2, and
so forth, and explain it with psql like this:

prepare foo (text) as select * from mytable where id = $1;
explain analyze execute foo ('foo');

On 9.2, though, this will explain the specific plan for those
parameters, so it might not be any different from what you already
EXPLAINed.

- Heikki


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Bad query plan with high-cardinality column
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG: endless lseek(.., SEEK_END) from select queries on x64 builds