Forcing postgres NOT to use sequential scan, trough JDBC

From: Mario Splivalo <mario(dot)splivalo(at)megafon(dot)hr>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Forcing postgres NOT to use sequential scan, trough JDBC
Date: 2009-03-06 10:50:12
Message-ID: 49B0FFE4.2030202@megafon.hr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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.

Mike

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2009-03-06 11:40:51 Re: Forcing postgres NOT to use sequential scan, trough JDBC
Previous Message Guillaume Smet 2009-03-05 20:56:29 Re: What do people use for connection pooling with PostgreSQL JDBC