Using Table Indexes After Joins

From: Alex Koay <alexkoay88(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Using Table Indexes After Joins
Date: 2012-03-30 19:31:28
Message-ID: CAG+qcA5xAnuuDMkbS1PR+w9BDHj=+gF=a-O951rNGcjkYZc6-A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Is it possible to use the original table indexes after a join?

I have a query like this:
SELECT lag(bar.d, 1) OVER (foo.a, foo.b, foo.c) FROM foo NATURAL JOIN bar

with an index on foo(a,b,c), but it doesn't seem to use the index for
the sort pre-window.
Note that foo and bar have a strict one-to-one relationship.

In such a case, would it be more advisable to use one single table instead?

Regards,
Alex

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Len 2012-03-30 20:09:36 Re: How to successfully create a new function?
Previous Message Jim Moon 2012-03-30 15:17:19 Re: How to successfully create a new function?