From: | Patrik Kudo <kudo(at)partitur(dot)se> |
---|---|
To: | Jan Wieck <jwieck(at)debis(dot)com> |
Cc: | maillist(at)candle(dot)pha(dot)pa(dot)us, pgsql-sql(at)postgreSQL(dot)org |
Subject: | Re: [SQL] Good Optimization |
Date: | 1999-07-08 09:23:14 |
Message-ID: | 37846E02.CB83939C@partitur.se |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Jan Wieck wrote:
>
> >
> > Bruce Momjian wrote:
> > >=20
> > > Added to TODO:
> > >=20
> > > * In WHERE x=3D3 AND x=3Dy, add y=3D3
> >
> > I don't know if I'm way off, but wouldn't removing "x=3Dy" improve
> > performance further?
>
> Maybe in the simple case above. But it will probably change
> the result set if someone issues
>
> SELECT a.x, b.y FROM a, b WHERE a.x >= 10
> AND a.x <= 19
> AND a.x = b.x;
>
> which should then get rewritten into
>
> SELECT a.x, b.y FROM a, b WHERE a.x >= 10
> AND a.x <= 19
> AND a.x = b.x
> AND b.x >= 10
> AND b.x <= 19;
>
> This time the "a.x = b.x" is important!
Ouch... didn't think that far. However, if an cache is implemented
it might be worth the extra overhead to optimize special cases like
the one I commented on. Since most systems use a fairly limited set
of queries (I suppose...) most of the queries will be cached quite
fast.
BTW, I just love the work all of you are doing! Postgres is awsome!
/Kudo
From | Date | Subject | |
---|---|---|---|
Next Message | Jan Wieck | 1999-07-08 10:24:20 | Re: [SQL] Good Optimization |
Previous Message | Jan Wieck | 1999-07-08 09:04:26 | Re: [SQL] Good Optimization |