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

filtering

From: "Kevin B(dot)" <db(at)ke5in(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: filtering
Date: 2004-12-09 15:25:25
Message-ID: 33039.67.87.27.161.1102605925.squirrel@www.ke5in.com (view raw or flat)
Thread:
Lists: pgsql-sql
Hi,

I have a 14 million row table with one index on two fields one is a varchar
the other is a date.  The combination of the two makes the row unique.

Data
-----------------
name  date    ... other fields
a     1/1/01
a     1/2/01
a     1/3/01
b     1/1/01
b     1/2/01
d     1/1/01
d     1/2/01

I have a table with just the names.  each name occurs once.
UName
---------
name
a
b
c
d

I've tried a number of queries to find which name is in UName but not in
Data.   However, they are all taking too long (more than 30 minutes - but
the hard drive is a slow 4200rpm IDE....).

What is the quickest query to get the result that I want?  Also, should I
put another index on the Data table for "name" only?

Thanks









Responses

pgsql-sql by date

Next:From: Alex BeamishDate: 2004-12-09 20:19:56
Subject: parse error at or near "(" -- Huh???
Previous:From: Matthew EngelbertDate: 2004-12-08 19:21:45
Subject: Indexing Strategy

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