Except operation - Mailing list pgsql-general

From Satyajeet Seth
Subject Except operation
Date
Msg-id Pine.LNX.4.10.9912020021060.3476-100000@vibhas.cse.iitd.ernet.in
Whole thread Raw
List pgsql-general
Hi
The query:
select * from webdata except select * from webdata1;
 takes abysmally long .How can I optimise it?
The particulars are:

tracedb=> \d webdata
Table    = webdata
+----------------------------------+----------------------------------+-------+
|              Field               |              Type                |
Length|
+----------------------------------+----------------------------------+-------+
| tid                              | int4                             |
4 |
| itemid                           | int4                             |
4 |
| ordering                         | int4                             |
4 |
+----------------------------------+----------------------------------+-------+

tracedb=> \d webdata1
Table    = webdata1
+----------------------------------+----------------------------------+-------+
|              Field               |              Type                |
Length|
+----------------------------------+----------------------------------+-------+
| tid                              | int4                             |
4 |
| itemid                           | int4                             |
4 |
| ordering                         | int4                             |
4 |
+----------------------------------+----------------------------------+-------+
tracedb=> select count(*) from webdata;
count
-----
91155
(1 row)

tracedb=> select count(*) from webdata1;
count
-----
 9550
(1 row)

Regards
Satya





pgsql-general by date:

Previous
From: Ed Loehr
Date:
Subject: Re: [GENERAL] "FATAL 1: my bits moved right off the end of theworld!"
Next
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] Date & Time