From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Patrice Drolet <pdrolet@infodata.ca>
Cc: pgsql-sql@postgresql.org
Subject: Re: Discordance between the way select is called.
Date: Sat, 7 May 2005 09:51:18 -0700 (PDT)
Message-ID: <20050507094623.W62726@megazone.bigpanda.com> (raw)
In-Reply-To: <42753A5A.6030004@infodata.ca>
References: <42753A5A.6030004@infodata.ca>
> Hi,
>
> I have a java app that uses hibernate to do queries.
>
> One query on a 6.5 millions records takes about 15 seconds while the
> same one (take from the sql that shows in the consol - I configured
> hibernate to show_sql) takes about 50 ms when done with pgadmin3.
We could answer better with explain output. Something like:
prepare foo(int) as select notevalue0_.id
as id, notevalue0_.value_note as value2_3_, notevalue0_.actif as
actif3_, notevalue0_.id_note as id4_3_, notevalue0_.id_field_name as
id5_3_ from note.note_value notevalue0_ where notevalue0_.id_note=$1 and
notevalue0_.actif=1;
explain analyze execute foo(<put a representative value here>);
-
As an initial guess, I'd wonder if it's guessing that for an arbitrary
id_note value that it should do a sequence scan. Are there a large number
of very common id_note values that might be throwing it off?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: sszabo@megazone.bigpanda.com, pdrolet@infodata.ca
Subject: Re: Discordance between the way select is called.
In-Reply-To: <20050507094623.W62726@megazone.bigpanda.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox