Re: help with getting index scan

From: "Thomas T(dot) Thai" <tom(at)minnesota(dot)com>
To: Masaru Sugawara <rk73(at)sea(dot)plala(dot)or(dot)jp>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: help with getting index scan
Date: 2002-03-06 06:08:44
Message-ID: Pine.NEB.4.43.0203060006580.8525-100000@ns01.minnesota.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marshall Spight 2002-03-06 06:20:09 Re: Conditional Statement
Previous Message Justin Clift 2002-03-06 00:52:51 Re: [HACKERS] Mandrake RPMs uploaded