Re: PHP Postgres query slower then PgAdmin

Поиск
Список
Период
Сортировка
От Emrah Mehmedov
Тема Re: PHP Postgres query slower then PgAdmin
Дата
Msg-id CAGRV00KpfX5-4gZiV2tcY+StYYTG04f0W3bV2XsFXUFtzVF3bw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PHP Postgres query slower then PgAdmin  (Bob Jolliffe <bobjolliffe@gmail.com>)
Ответы Re: PHP Postgres query slower then PgAdmin
Список pgsql-performance
Can we modify php connection?


On Wed, Jun 5, 2013 at 1:01 PM, Bob Jolliffe <bobjolliffe@gmail.com> wrote:
Is php connecting through tcp whilst pgadmin is using unix domain socket?  Probably the query time is the same, but returning the result over tcp will be slower.


On 5 June 2013 11:18, Emrah Mehmedov <emrah.mehmedov@x3mlabs.com> wrote:
Hello,

I'm using php5.4.12 with extension=php_pgsql.dll enabled but the query that i'm trying to execute is faster on PgAdmin app.

SELECT title, ts_rank_cd(vector, query) AS rank FROM links, to_tsquery('english', 'risk') query WHERE query @@ vector ORDER BY rank DESC;

I'm not sure, what can i do to increase the speed of execution from php:

$start_time = microtime(true);
$query = "SELECT title, url, ts_rank_cd(vector, query) AS rank FROM links, to_tsquery('english', 'risk') query WHERE query @@ vector ORDER BY rank DESC LIMIT 10;";
$result = pg_query($connection, $query);
$end_time = microtime(true);

persistant connections are enabled in php.ini but i calculate only execution time from start to end.

Thanks, Emrah.

--
Best regards, Emrah Mehmedov
Software Developer @ X3M Labs
http://www.extreme-labs.com




--
Best regards, Emrah Mehmedov
Software Developer @ X3M Labs
http://www.extreme-labs.com

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

Предыдущее
От: Bob Jolliffe
Дата:
Сообщение: Re: PHP Postgres query slower then PgAdmin
Следующее
От: Bob Jolliffe
Дата:
Сообщение: Re: PHP Postgres query slower then PgAdmin