Re: disabling seq scans

Поиск
Список
Период
Сортировка
От Sean Shanny
Тема Re: disabling seq scans
Дата
Msg-id 406C7D48.5080809@earthlink.net
обсуждение исходный текст
Ответ на disabling seq scans  ("Marcus Andree S. Magalhaes" <marcus.magalhaes@vlinfo.com.br>)
Ответы Re: disabling seq scans
Список pgsql-jdbc
I do the following in several reports I run.....

statement = m_conn.createStatement();
statement.executeUpdate( "set enable_seqscan = false" );
do your thing....
statement.executeUpdate( "set enable_seqscan = true" );

--sean

Marcus Andree S. Magalhaes wrote:

>Hi, guys,
>
>We're experiencing a little problem with one of our queries.
>It isn't using an index specially created for it. When we
>disable seq scans with psql, we can ensure the query finishes
>much faster than without using index, as it should be.
>
>So, whats the best procedure in this case, but when have a
>JDBC based client? Do we mess around with planner
>settings even when all other queries are using the best
>index for them?
>
>Is it safe (but some may find ugly) to issue a command to
>disable seq scanning from the java side?
>
>Since we're using the pooled connection classes that comes
>with the JDBC3 driver, once a connection is got from the pool,
>do we need to explicitly set seq scanning to true? This is
>assuming the later option is the more recommended one...
>
>TIA
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 8: explain analyze is your friend
>
>
>

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

Предыдущее
От: "Marcus Andree S. Magalhaes"
Дата:
Сообщение: disabling seq scans
Следующее
От: "Marcus Andree S. Magalhaes"
Дата:
Сообщение: Re: disabling seq scans