Re: Table Design question for gurus (without going to "NoSQL")...

From: David Johnston <polobo(at)yahoo(dot)com>
To: Phoenix Kiula <phoenix(dot)kiula(at)gmail(dot)com>
Cc: Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>, PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Table Design question for gurus (without going to "NoSQL")...
Date: 2011-11-21 03:17:49
Message-ID: 8283C8CD-86BB-4CE3-9E4A-0880068BDFEC@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Nov 20, 2011, at 20:50, Phoenix Kiula <phoenix(dot)kiula(at)gmail(dot)com> wrote:

> On Mon, Nov 21, 2011 at 7:26 AM, Gavin Flower
> <GavinFlower(at)archidevsys(dot)co(dot)nz> wrote:
>
>> How about having 2 indexes: one on each of ip & url_md5? Pg will combine the
>> indexes as required, or will just use one if that is best.
>
>
>
> Thanks Gavin. Question: what if I have a joined index? If from a
> joined index I only use the first column (say, "ip") will a joined
> index still be used?
>
> It is cleaner to create two indexes for the two columns. Which is recommended?
>

An index on (a, b) can be used for queries involving only a but not for those involving only b.

Neither is recommended - both have their benefits and limitations.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargentg 2011-11-21 03:27:58 Re: 9.1.1 build failure : postgres link fails
Previous Message Tomas Vondra 2011-11-21 02:54:25 Re: Installed. Now what?