Re: Forcing postgres NOT to use sequential scan, trough JDBC

Поиск
Список
Период
Сортировка
От Mario Splivalo
Тема Re: Forcing postgres NOT to use sequential scan, trough JDBC
Дата
Msg-id 49B4DB11.6040008@megafon.hr
обсуждение исходный текст
Ответ на Forcing postgres NOT to use sequential scan, trough JDBC  (Mario Splivalo <mario.splivalo@megafon.hr>)
Ответы Re: Forcing postgres NOT to use sequential scan, trough JDBC  (Dave Cramer <pg@fastcrypt.com>)
Список pgsql-jdbc
Mario Splivalo wrote:
> How do I tell postgres not to use sequential scan, trough jdbc?
>
> I tried to include 'SET enable_seqscan TO false;' at the begining of the
> plpgsql function, but that seems to work only if I call the function
> trough the psql, and only for the subsequent calls in the current
> session. I 'know' that postgres is using sequential scan because
> function call takes cca 400ms. When I force postgres not to use
> sequential scan, the function takes around 5-10ms.
>
> I even tried, on the same connection, to issue 'SET enable_seqscan TO
> false;' trough jdbc before I call my function, but execution time is
> still around 400ms.
>

As it turns out, one can say 'SET senable_seqscan TO false;' at the
begining of the plpgsql function. The problem was that I had setup
Tomcat so that it keeps only 10 persistent connections. When I set it up
to keep 100 persistent connections the load was minimal.

    Mike

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Documentation for working with PG interval types via JDBC
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: Forcing postgres NOT to use sequential scan, trough JDBC