Difference in query performance when made from C/C++ client vs. psql client.

Поиск
Список
Период
Сортировка
От Aditya Rastogi
Тема Difference in query performance when made from C/C++ client vs. psql client.
Дата
Msg-id BAY176-W3C969C1105340CF81826BC53D0@phx.gbl
обсуждение исходный текст
Ответы Re: Difference in query performance when made from C/C++ client vs. psql client.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
Hi,

I am running a postgreSQL database to which multiple C/C++ clients send queries via the libpq interface. On an expensive query doing multiple levels of aggregation on a large dataset, I observe that the CPU usage of the postmaster process goes up to 100 % and the query never completes. However, If I connect to the database via the psql terminal client and execute the same query on the same data set, it takes only a few milliseconds to complete (with the top command showing only a momentary spike in the CPU usage of the postmaster process), irrespective of the size of the underlying data set. Moreover , for a very small data set in the database , the same query never hangs when made through the libpq interface. I am puzzled by this difference in performance. Doesn't the psql client use the same libpq interface to send the queries to the database ? Any help on where to start would be appreciated.

Thanks
Aditya 

В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: upgrading from postgresql 8.4 - postgis 1.3.6 to postgresql 9.2/postgis2.0
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Difference in query performance when made from C/C++ client vs. psql client.