pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <robertmhaas@gmail.com>
To: Faheem Mitha <faheem@email.unc.edu>
Cc: Eliot Gable <egable+pgsql-performance@gmail.com>
Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: pgsql-performance@postgresql.org
Subject: Re: experiments in query optimization
Date: Thu, 1 Apr 2010 14:50:59 -0400
Message-ID: <w2q603c8f071004011150h4bf8c5bs2b00041b51b0bb49@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1004012230520.17251@orwell.homelinux.org>
References: <alpine.DEB.2.00.1003251457350.13883@orwell.homelinux.org>
	<603c8f071003291102g778afc2fvda0fc281454526c9@mail.gmail.com>
	<alpine.DEB.2.00.1003292349490.13883@orwell.homelinux.org>
	<4BB1DB9A020000250003020E@gw.wicourts.gov>
	<alpine.DEB.2.00.1003302151030.13883@orwell.homelinux.org>
	<603c8f071003301259u140d8556vc54ff46855013bd3@mail.gmail.com>
	<alpine.DEB.2.00.1003311506300.13883@orwell.homelinux.org>
	<alpine.DEB.2.00.1004011708460.26028@orwell.homelinux.org>
	<p2mbf6923ed1004010931y43e9fe45mb5be9117b53cbb36@mail.gmail.com>
	<alpine.DEB.2.00.1004012230520.17251@orwell.homelinux.org>

On Thu, Apr 1, 2010 at 2:15 PM, Faheem Mitha <faheem@email.unc.edu> wrote:
> I had set the foreign keys in question (on the geno table) to be primary
> keys. This is because this setup is basically a glorified spreadsheet, and I
> don't want more than one cell corresponding to a particular tuple of
> idlink.id and anno.id (the conceptual rows and cols). Since a primary key
> defines an index, I thought putting indexes on idlink_id and anno_id was
> redundant. However, it looks like (unsurprisingly) the index corresponding
> to the primary key is across both columns, which may not be what is wanted
> for the aforesaid join

Actually it is what is wanted - that is good.

> So, should I add indexes on the individual foreign key cols idlink_id
> and anno_id after all?

I doubt that would help.

The bottom line may be that you're dealing with hundreds of millions
of rows here, so things are going to take a long time.  Of course you
can always get more/faster memory, a bigger I/O subsystem, faster
processors...  and it could be that with detailed study there are
optimizations that could be done even without spending money, but I
think I'm about tapped out on what I can do over an Internet mailing
list.

...Robert



view thread (20+ messages)  latest in thread

Message-ID: <w2q603c8f071004011150h4bf8c5bs2b00041b51b0bb49@mail.gmail.com>
Permalink:  ../w2q603c8f071004011150h4bf8c5bs2b00041b51b0bb49@mail.gmail.com/
Also on:    postgresql.org/message-id/w2q603c8f071004011150h4bf8c5bs2b00041b51b0bb49@mail.gmail.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: robertmhaas@gmail.com, faheem@email.unc.edu, egable+pgsql-performance@gmail.com, Kevin.Grittner@wicourts.gov
  Subject: Re: experiments in query optimization
  In-Reply-To: <w2q603c8f071004011150h4bf8c5bs2b00041b51b0bb49@mail.gmail.com>
  References: <alpine.DEB.2.00.1003251457350.13883@orwell.homelinux.org> <603c8f071003291102g778afc2fvda0fc281454526c9@mail.gmail.com> <alpine.DEB.2.00.1003292349490.13883@orwell.homelinux.org> <4BB1DB9A020000250003020E@gw.wicourts.gov> <alpine.DEB.2.00.1003302151030.13883@orwell.homelinux.org> <603c8f071003301259u140d8556vc54ff46855013bd3@mail.gmail.com> <alpine.DEB.2.00.1003311506300.13883@orwell.homelinux.org> <alpine.DEB.2.00.1004011708460.26028@orwell.homelinux.org> <p2mbf6923ed1004010931y43e9fe45mb5be9117b53cbb36@mail.gmail.com> <alpine.DEB.2.00.1004012230520.17251@orwell.homelinux.org> <w2q603c8f071004011150h4bf8c5bs2b00041b51b0bb49@mail.gmail.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