Skip to Main Content

PHP Query Hangs

894574Oct 14 2011 — edited Jan 30 2013
Hardware: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0
CodeIgniter: 2.0.3
Using the OCI8 diver.
PHP Version: 5.1.6

I'm running in to a problem where one of the columns types that we are selecting seems to be hanging the script. The type is a VARCHAR2(700). I'm not sure if its a memory problem or what. But for example WHERE rownum <= 30 may cause the browser to hang and sit there and never time out. But WHERE rownum <=29 may return all 29 rows. Now when I convert it TO_CLOB(column), this actually works and it wont hang, but of course takes longer the more rows I have to return.

Also, when the window hangs and I do a 'top' I see these sessions hagning also by apache:

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
13549 apache 15 0 178m 19m 9.9m S 0.0 0.5 0:01.45 httpd
16031 apache 15 0 178m 19m 9876 S 0.0 0.5 0:00.15 httpd
16464 apache 25 0 724m 7740 1444 S 0.0 0.2 0:00.01 httpd
17948 apache 15 0 178m 19m 9m S 0.0 0.5 0:00.37 httpd
22127 apache 18 0 177m 16m 7948 S 0.0 0.4 0:00.08 httpd
24141 apache 15 0 177m 16m 7948 S 0.0 0.4 0:00.08 httpd
24864 apache 18 0 175m 15m 8232 S 0.0 0.4 0:00.03 httpd
25873 apache 15 0 178m 20m 10m S 0.0 0.5 0:01.70 httpd
25895 apache 18 0 177m 18m 9612 S 0.0 0.4 0:01.31 httpd
26665 apache 15 0 177m 16m 8360 S 0.0 0.4 0:00.08 httpd

And it not only hangs in PHP but a PERL script using the OCI8 dll also hangs when trying to select data from that same column type.

So what is it about this VARCHAR2(700) thats killing my scripts? Im new to Oracle so thanks for any advice.
Comments
Post Details
Added on Oct 14 2011
6 comments
4,231 views