Skip site navigation (1) Skip section navigation (2)

Re: avoiding seqscan?

From: Christopher Browne <cbbrowne(at)libertyrms(dot)info>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: avoiding seqscan?
Date: 2003-09-29 15:12:55
Message-ID: 60vfrbzkzs.fsf@dev6.int.libertyrms.info (view raw or flat)
Thread:
Lists: pgsql-performance
girgen(at)pingpong(dot)net (Palle Girgensohn) writes:
> Will that make a difference? From what I've seen, it does not make
> much difference, but I have seen queries speed up when rewritten
> explicit joins. I guess it depends on other things, but is it really
> so that the explicit joins are bad somehow? Do you have any pointers
> to documentation about it, if so?

The problem is that if you expressly specify the joins, the query
optimizer can't choose its own paths.  And while that may not be
better at the moment, it is quite possible that when you upgrade to a
newer version, those queries, if "not join-specified," could
immediately get faster.

I would expect that the query that uses implicit joins will be clearer
to read, which adds a little further merit to that direction.

That goes along with the usual way that it is preferable to optimize
things, namely that you should start by solving the problem as simply
as you can, and only proceed to further optimization if that actually
proves necessary.  Optimization efforts commonly add complexity and
make code more difficult to maintain; that's not the place to start if
you don't even know the effort is necessary.
-- 
(format nil "~S(at)~S" "cbbrowne" "libertyrms.info")
<http://dev6.int.libertyrms.com/>
Christopher Browne
(416) 646 3304 x124 (land)

In response to

Responses

pgsql-performance by date

Next:From: gregDate: 2003-09-29 15:23:49
Subject: Re: [PERFORM] Plan-Reading
Previous:From: Franco Bruno BorghesiDate: 2003-09-29 14:59:27
Subject: Re: Performance: BigInt vs Decimal(19,0)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group