Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/29/14, David Noel <david.i.noel@xxxxxxxxx> wrote:
> 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"

Relevant schema below:

-------------------------------------------------

CREATE TABLE page
(
  "URL" text NOT NULL,
  "Title" text,
  "Article" text,
  "PublishDate" timestamp with time zone,
  "SiteName" text,
  "Classification" text,
...etc...
  CONSTRAINT page_pkey PRIMARY KEY ("URL")
)
WITH (
  OIDS=FALSE
);
ALTER TABLE page
  OWNER TO dba;

-------------------------------------------------

CREATE TABLE sentence
(
  "UUID" serial NOT NULL,
  "IDSentence" text NOT NULL,
  "Contents" text,
  "IDAuthor" text,
  "CreatedAt" text,
  "PageURL" text NOT NULL,
  CONSTRAINT sentence_pkey PRIMARY KEY ("UUID"),
  CONSTRAINT idpage_fkey FOREIGN KEY ("PageURL")
      REFERENCES page ("URL") MATCH Unknown
      ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
  OIDS=FALSE
);
ALTER TABLE sentence
  OWNER TO dba;

-------------------------------------------------

-David


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux