Re: help with getting index scan - Mailing list pgsql-general

From Thomas T. Thai
Subject Re: help with getting index scan
Date
Msg-id Pine.NEB.4.43.0203060006580.8525-100000@ns01.minnesota.com
Whole thread Raw
In response to Re: help with getting index scan  (Masaru Sugawara <rk73@sea.plala.or.jp>)
Responses Re: help with getting index scan  (Oliver Elphick <olly@lfix.co.uk>)
Re: help with getting index scan  ("Thomas T. Thai" <tom@minnesota.com>)
List pgsql-general
On Wed, 6 Mar 2002, Masaru Sugawara wrote:

Both of your queries generated an error:

ERROR:  parser: parse error at or near "WHERE"

I can't see which where it is though.

[...]
>  I would think there is obviously room for more research. To force the planner
>  use the InitPlan, my two queries are changed a bit:
>
> set enable_seqscan to on;
> explain analyze   --- (1')
> SELECT *
>   FROM (SELECT p.name, p.address, p.city, p.state,
>                geo_distance((SELECT point(z.longitude, z.latitude)
>                                FROM zipcodes AS z
>                               WHERE z.zip_code='55404'),
>                              point(p.long, p.lat)) as dist
>           FROM phone_address AS p,
>                (SELECT * FROM phone_cat WHERE nameftx ## 'salon') AS pc,
>                phone_cat_address AS pca,
>          WHERE pc.cid = pca.cid AND pca.aid = p.aid
>        ) AS ss
>  WHERE ss.dist < 35
>  ORDER BY ss.dist
> LIMIT 20;
>
>
> set enable_seqscan to on;
> explain analyze   --- (2')
> SELECT *
>   FROM (SELECT p.name, p.address, p.city, p.state,
>                geo_distance((SELECT point(z.longitude, z.latitude)
>                                FROM zipcodes AS z
>                               WHERE z.zip_code='55404'),
>                              point(p.long, p.lat)) as dist
>           FROM phone_address AS p,
>                (SELECT * FROM phone_cat WHERE nameftx ## 'salon'
>                 ORDER BY cid) AS pc,
>                phone_cat_address AS pca,
>          WHERE pc.cid = pca.cid AND pca.aid = p.aid
>        ) AS ss
>  WHERE ss.dist < 35
>  ORDER BY ss.dist
> LIMIT 20;

--
Thomas T. Thai
Minnesota.com, Inc.




pgsql-general by date:

Previous
From: Justin Clift
Date:
Subject: Re: [HACKERS] Mandrake RPMs uploaded
Next
From: Oliver Elphick
Date:
Subject: Re: help with getting index scan