Hi Pierce It would be cool if we could get a little success stories around what you are doing. A success stories does not mean that you get as rich as Steve Jobs, just that you build something nice successfully. ;) Stef On Sun, Nov 26, 2017 at 9:43 AM, Pierce Ng <pierce@samadhiweb.com> wrote:
Hi Sven and all,
I have a PostgreSQL database running in a resource-light Linux VM with ~4 million rows consisting of mostly text. My query executes regexp_matches() on the text and it runs noticeably slowly.
I am encountering ConnectionTimedOut using P3 to run my query. PostgresV2 and Python's pg8000 do work though. I see that PostgresV2's PGConnection uses "Socket standardTimeout". I changed ZdcSimpleSocketStream class-side's #openConnectionToHostNamed:port: bottom part to add the same timeout because P3Client>>open calls it:
ZdcSimpleSocketStream class>>openConnectionToHostNamed: hostName port: portNumber [...] ^ socketStream timeout: Socket standardTimeOut; "<== added this line" connectTo: hostIP port: portNumber; yourself
Now my query returns instead of timing out.
It does look like ZdcSimpleSocketStream's three class-side methods could use some refactoring love.
Pierce