SQL query runs fine on one platform (FreeBSD), but hangs on another (Windows)

From: David Noel <david(dot)i(dot)noel(at)gmail(dot)com>
To: PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: SQL query runs fine on one platform (FreeBSD), but hangs on another (Windows)
Date: 2014-04-29 06:59:14
Message-ID: CAHAXwYC0otNfPTHDrNfg3=qs2KOg1YZ6UvpAXZQWkLuSZJR3yA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The query I'm running is:

"select page.*, coalesce((select COUNT(*) from sentence where
sentence."PageURL" = page."URL" group by page."URL"), 0) as
NoOfSentences from page WHERE "Classification" LIKE CASE WHEN "<>"
THEN " ELSE '%' END ORDER BY "PublishDate" DESC Offset 0 LIMIT 100"

I can post the table definitions if that would be helpful but I don't
have them on hand at the moment.

The gist of it though is that "page" and "sentence" are two tables.
page.URL maps to sentence.PageURL. The page table has the columns
"Classification", and "PublishDate". URL, PageURL, and Classification
are strings. PublishDate is a timestamp with timezone.

Both queries are run from a Java project using the latest JDBC driver.
The PostgreSQL Server versions it's being run on are 9.2 and 9.3. The
query executes and returns just fine when run on a FreeBSD-based
platform, but executes forever when run under Windows.

Does anyone have any idea why this might be happening? Are there
platform/syntax compatibility issues I'm triggering here that I'm
unaware of? Is there something wrong with the query?

We're going to try to test it under Linux too, but that system will
have to be set up first so it might be a while before we know those
results.

Any thoughts would be appreciated,

David Noel

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Achilleas Mantzios 2014-04-29 07:33:56 Re: SQL query runs fine on one platform (FreeBSD), but hangs on another (Windows)
Previous Message David G Johnston 2014-04-29 00:08:30 Re: xml question