Re: Multi-column index: Which column order

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Multi-column index: Which column order
Date: 2023-02-15 16:20:31
Message-ID: 3728c419-a158-4821-d736-dbd63a79c30d@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2/15/23 02:46, Laurenz Albe wrote:
[snip]
> Which one is best?
>> CREATE UNIQUE INDEX ix1 ON art (code, etb)
>> or
>> CREATE UNIQUE INDEX ix1 ON art (etb, code)
>>
>> (or its PRIMARY KEY equivalent)
> Both are the same.
>
> There is an old myth that says that you should use the moew selective column first
> (which would be "code"), but that is just a myth.

Only on Postgresql?

--
Born in Arizona, moved to Babylonia.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Zheng Li 2023-02-15 22:16:05 Re: Support logical replication of DDLs
Previous Message Ron 2023-02-15 16:17:31 Re: Query plan for "id IS NULL" on PK