Re: Discordance between the way select is called.
От | Stephan Szabo |
---|---|
Тема | Re: Discordance between the way select is called. |
Дата | |
Msg-id | 20050507094623.W62726@megazone.bigpanda.com обсуждение исходный текст |
Ответ на | Discordance between the way select is called. (Patrice Drolet <pdrolet@infodata.ca>) |
Список | pgsql-sql |
> 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_.idas id, notevalue0_.value_note as value2_3_, notevalue0_.actif asactif3_, notevalue0_.id_noteas id4_3_, notevalue0_.id_field_name asid5_3_ from note.note_value notevalue0_ where notevalue0_.id_note=$1andnotevalue0_.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?
В списке pgsql-sql по дате отправления: