pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin B. <db@ke5in.com>
To: pgsql-sql@postgresql.org
Subject: filtering
Date: Thu, 9 Dec 2004 10:25:25 -0500 (EST)
Message-ID: <33039.67.87.27.161.1102605925.squirrel@www.ke5in.com> (raw)

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











view thread (4+ messages)  latest in thread

Message-ID: <33039.67.87.27.161.1102605925.squirrel@www.ke5in.com>
Permalink:  ../33039.67.87.27.161.1102605925.squirrel@www.ke5in.com/
Also on:    postgresql.org/message-id/33039.67.87.27.161.1102605925.squirrel@www.ke5in.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: db@ke5in.com
  Subject: Re: filtering
  In-Reply-To: <33039.67.87.27.161.1102605925.squirrel@www.ke5in.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox