Re: Strange discrepancy in query performance...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Strange discrepancy in query performance...
Дата
Msg-id 13949.1191334410@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Strange discrepancy in query performance...  ("Jason L. Buberel" <jason@buberel.org>)
Ответы Re: Strange discrepancy in query performance...  ("Jason L. Buberel" <jason@buberel.org>)
Список pgsql-general
"Jason L. Buberel" <jason@buberel.org> writes:
> For reference, when using JasperReports .jrxml files as the basis for
> the query, I only had to do to the following to 'force' postgres to
> treat the jasper report parameter as a number and not text, thereby
> allowing the correct index to be used:

> select * from city summary where city_master_id =
> $P{city_master_id}::bigint ...

> Query times went from 300+ seconds back down to ~100ms.

Hmm ... if Postgres were just given the parameter symbol with no type
information, I believe it would have assumed it was bigint (or in
general, the same type as what it's being compared to).  So your
problem suggests that Jasper is deliberately telling the backend that
that parameter is of type text.  If that's coming from something you
did in your code, you probably ought to change the code.  If not,
it seems like a bug/omission in Jasper.

            regards, tom lane

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

Предыдущее
От: Douglas McNaught
Дата:
Сообщение: Re: Execution plan caching
Следующее
От: Stefan Schwarzer
Дата:
Сообщение: Re: Find min year and min value