[Geodata] Tiger - can't get SQL to use indexes in postgres

Obe, Regina robe.dnd at cityofboston.gov
Mon Jun 23 12:20:01 EDT 2008


Stay away from natural joins.  I tend to think they are terrible to use
because they blindly join liked named things so your gid = gids will be
joined. 

there actually is no performance benefit to natural joins -  just a lazy
way of joining things.

-----Original Message-----
From: geodata-bounces at lists.osgeo.org
[mailto:geodata-bounces at lists.osgeo.org] On Behalf Of Wolf Bergenheim
Sent: Monday, June 23, 2008 11:37 AM
To: Stephen Woodbridge; geodata at lists.osgeo.org
Subject: Re: [Geodata] Tiger - can't get SQL to use indexes in postgres

On 23.06.2008 19:14, Stephen Woodbridge wrote:
> 
> Any thoughts on speeding this up?
>   -Steve 

> select count(*) from addr a, addrfn b, featnames c where a.arid=b.arid
and b.linearid=c.linearid;

Have you tried natural joins instead? It _should_ be faster then a 
select using only where.

select count(*) from addr natural join ( addrfn natural join featnames )

--Wolf

-- 

<:3 )---- Wolf Bergenheim ----( 8:>

_______________________________________________
Geodata mailing list
Geodata at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/geodata
-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.



More information about the Geodata mailing list