> Well, as I said, doing the same test from PSQL, the performance
> difference is much less. I was really asking about the difference
> between psql and PsqlODBC:
>
> psql(output to file) psqlodbc
> UNION total time: < 12 sec first row received after
> 30 seconds
> UNION ALL total time < 4 sec first row received instantly
I suppose you have used Declare/Fetch turned on. Please try the same
query in psql client. The exact query you can find in mylog output.
It could be something like
DECLARE CURSOR <CURSOR_NAME> FOR SELECT <your select>;
FETCH FORWARD <number of rows to fetch at first time> FROM <CURSOR_NAME>;
If you have used Server side prepare then query is already different.
It use:
PREPARE <plan_name>[(paremters types)] AS <query>;
EXECUTE <plan_name> [(parameters)];
Regards,
Luf