dbTalk Databases Forums  

ecpg - Poor fetch performance

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss ecpg - Poor fetch performance in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Steve McAllister
 
Posts: n/a

Default ecpg - Poor fetch performance - 08-15-2004 , 05:29 PM






How can I improve the performance of my ecpg based program in version 7.4.2
of Postgresql.



The structure of my code looks like the following.



EXEC SQL Declare cursor A;

EXEC SQL open A; # Approximately 15,000 rows selected



Do {



EXEC SQL fetch from A into ....;



EXEC SQL Declare cursor B;

EXEC SQL open B; # Approximately 15 rows selected from a fairly
complex join



Do {



EXEC SQL fetch from B into ....; # Execute time
approx 200ms



} while (..);



EXEC SQL close cursor B;



} while (...);



EXEC SQL close cursor A;



Based on the above comments the total execution time is approx 12.5 hours.



My question is why does the inner fetch take 200ms to execute? I would
expect Open Cursor B to execute in approx 200ms. But I would expect the
fetch to be a read from some buffer area. Given that the fetch executes in
200ms this leads me to believe the fetch is re-executing the query each
time.



Can anyone help. Please.



Regards



Steve McAllister



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.