From:
Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To:
maillist(at)candle(dot)pha(dot)pa(dot)us (Bruce Momjian)
Cc:
daveh(at)insightdist(dot)com, hannu(at)trust(dot)ee, pgsql-interfaces(at)postgreSQL(dot)org,
hackers(at)postgreSQL(dot)org
Subject:
Re: [INTERFACES] Re: [HACKERS] changes in 6.4
Date:
1998-07-16 01:22:33
Message-ID:
199807160122.VAA08917@candle.pha.pa.us (view raw or flat )
Thread:
1998-07-14 13:01:11 from t-ishii(at)sra(dot)co(dot)jp (Tatsuo Ishii)
1998-07-14 13:42:47 from Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
1998-07-14 15:09:29 from "Thomas G(dot) Lockhart" <lockhart(at)alumnus(dot)caltech(dot)edu>
1998-07-14 15:37:17 from Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
1998-07-15 10:04:26 from Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
1998-07-15 14:42:00 from Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
1998-07-15 19:52:25 from Hannu Krosing <hannu(at)trust(dot)ee>
1998-07-15 20:23:47 from Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
1998-07-15 20:25:44 from Vadim Mikheev <vadim(at)krs(dot)ru>
1998-07-15 20:39:39 from Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
1998-07-16 07:45:18 from Maarten Boekhold <maartenb(at)dutepp0(dot)et(dot)tudelft(dot)nl>
1998-07-16 08:30:11 from Hannu Krosing <hannu(at)trust(dot)ee>
1998-07-16 08:51:35 from Vadim Mikheev <vadim(at)krs(dot)ru>
1998-07-16 10:56:40 from Hannu Krosing <hannu(at)trust(dot)ee>
1998-07-16 13:36:01 from "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
1998-07-16 18:29:26 from dg(at)illustra(dot)com (David Gould)
1998-07-16 18:37:17 from Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
1998-07-15 20:40:56 from David Hartwig <daveh(at)insightdist(dot)com>
1998-07-15 21:02:40 from Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
1998-07-16 10:35:30 from Aleksey Dashevsky <postgres(at)luckynet(dot)co(dot)il>
1998-07-16 15:33:35 from Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
1998-07-16 17:27:03 from Peter T Mount <peter(at)retep(dot)org(dot)uk>
1998-07-15 22:16:02 from David Hartwig <daveh(at)insightdist(dot)com>
1998-07-15 23:39:05 from Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
1998-07-16 01:22:33 from Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
1998-07-16 08:41:47 from Hannu Krosing <hannu(at)trust(dot)ee>
1998-07-16 13:49:27 from "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
1998-07-17 07:18:03 from Hannu Krosing <hannu(at)trust(dot)ee>
1998-07-16 17:30:25 from Peter T Mount <peter(at)retep(dot)org(dot)uk>
1998-08-22 03:53:39 from Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
1998-08-23 23:55:29 from David Hartwig <daybee(at)bellatlantic(dot)net>
1998-08-29 03:44:04 from Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
1998-08-30 15:40:31 from David Hartwig <daybee(at)bellatlantic(dot)net>
1998-08-31 06:53:12 from Sbragion Denis <infotecn(at)tin(dot)it>
1999-09-18 20:10:11 from Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
1999-09-19 11:17:49 from "Jason Doller" <jason(at)intekom(dot)co(dot)za>
1999-09-19 14:57:40 from "Brett W(dot) McCoy" <bmccoy(at)lan2wan(dot)com>
Lists:
pgsql-general pgsql-hackers pgsql-interfaces
> > The results are profound. Queries that used to scan tables because of the
> OK, I have an idea. Just today, we allow:
>
> select *
> from tab1
> where val in (
> select x from tab2
> union
> select y from tab3
> )
>
> How about if instead of doing:
>
> select * from tab1 where val = 3
> union
> select * from tab1 where val = 4
> ...
>
> you change it to:
>
> select * from tab1 where val in (
> select 3
> union
> select 4
> )
OK, I just ran some test, and it does not look good:
---------------------------------------------------------------------------
son_db=> explain select mmatter from matter where mmatter = 'A01-001';
NOTICE: QUERY PLAN:
Index Scan using i_matt2 on matter (cost=2.05 size=1 width=12)
EXPLAIN
son_db=> explain select mmatter from matter where mmatter in (select 'A01-001');
NOTICE: QUERY PLAN:
Seq Scan on matter (cost=512.20 size=1001 width=12)
SubPlan
-> Result (cost=0.00 size=0 width=0)
EXPLAIN
---------------------------------------------------------------------------
Turns out indexes are not used in outer queries of subselects. Not sure
why. Vadim?
--
Bruce Momjian | 830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us | Drexel Hill, Pennsylvania 19026
+ If your life is a hard drive, | (610) 353-9879(w)
+ Christ can be your backup. | (610) 853-3000(h)
In response to
pgsql-hackers by date
Next :From: Maarten BoekholdDate: 1998-07-16 07:45:18
Subject : Re: [INTERFACES] Re: [HACKERS] changes in 6.4
Previous :From : Vadim MikheevDate : 1998-07-15 23:46:25
Subject : proposals for LLL, part 1
pgsql-interfaces by date
Next :From: JeffDate: 1998-07-16 05:22:48
Subject : Problems with CGI to read database.
Previous :From : Bruce MomjianDate : 1998-07-15 23:39:05
Subject : Re: [INTERFACES] Re: [HACKERS] changes in 6.4
pgsql-general by date
Next :From: Robert CampbellDate: 1998-07-16 04:52:53
Subject : null as a value
Previous :From : 1214Date : 1998-07-15 23:41:47
Subject : Mega-Cash Wants To Advertise On Your Site!