postgresql - Postrgresql query slow only fromn pg_query of PHP -
i'm doing query php postgresql , it's extremely slow. query select *, cast(data->>'created_at' timestamp) fecha gorda_lipo.tweets idusuario = 125379829 limit 20
on phppgadmin tooks 21.172 ms, if try query on php pg_query(the connection, query)
query canceled because of timeout, , if try manually cancel using select pg_cancel_backend(pid);
takes more 1 minute.
if make query
select *, cast(data->>'created_at' date) fecha,cast(data->>'id' bigint) idusuario gorda_lipo.usuarios cast(data->>'id' bigint) = (select *from (select cast(data->>'id' bigint) gorda_lipo.usuarios limit 50) t order random() limit 1)
works fine. pretend use result idusuario of first query, doens't work if use number instead.
why query slow on php pg_query ? doing wrong? there plugin use?
take @ php.ini's max_execution_time value. there's no reason query slower when querying php, trying display data @ once.
Comments
Post a Comment