Re: Query planning around one key of a multi-column index

Craig James <[email protected]> Wed, 18 Dec 2019 19:02:45 -0800
Newsgroups gmane.comp.db.postgresql.admin
Message-ID <CAFwQ8reu3kbbREr2M2i-7o7C-UdTOpMybRyMzbkcCwjhmiyMYQ@mail.gmail.com>
--0000000000004b910c059a05cc9e
Content-Type: text/plain; charset="UTF-8"

Google is your friend:
http://www.postgresqltutorial.com/postgresql-indexes/postgresql-multicolumn-indexes/

On Wed, Dec 18, 2019 at 4:43 PM Wells Oliver <[email protected]> wrote:

> I've been using PG now for so many years and I don't have a solid concrete
> answer on this in my head, and I feel like I should: if I have a table with
> a multi-column index and I query on one of those columns (or some subset of
> those columns), will it use that index?
>
> Is there more reading on this topic? I've always felt it's a little more
> complicated but I'm not quite sure.
>
> --
> Wells Oliver
> [email protected] <[email protected]>
>


-- 
---------------------------------
Craig A. James
Chief Technology Officer
eMolecules, Inc.
3430 Carmel Mountain Road, Suite 250
San Diego, CA 92121
---------------------------------

--0000000000004b910c059a05cc9e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Google is your friend:<div><a href=3D"http://www.postgresq=
ltutorial.com/postgresql-indexes/postgresql-multicolumn-indexes/">http://ww=
w.postgresqltutorial.com/postgresql-indexes/postgresql-multicolumn-indexes/=
</a><br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=
=3D"gmail_attr">On Wed, Dec 18, 2019 at 4:43 PM Wells Oliver &lt;<a href=3D=
"mailto:[email protected]">[email protected]</a>&gt; wrote:<br></=
div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bor=
der-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div=
>I&#39;ve been using PG now for so many years and I don&#39;t have a solid =
concrete answer on this in my head, and I feel like I should: if I have a t=
able with a multi-column index and I query on one of those columns (or some=
 subset of those columns), will it use that index?</div><div><br></div><div=
>Is there more reading on this topic? I&#39;ve always felt it&#39;s a littl=
e more complicated but I&#39;m not quite sure.<br></div><div><br>-- <br><di=
v dir=3D"ltr"><div dir=3D"ltr"><div>Wells Oliver<br><a href=3D"mailto:wells=
[email protected]" target=3D"_blank">[email protected]</a></div></div><=
/div></div></div>
</blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"=
 class=3D"gmail_signature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div=
><div>---------------------------------<br>Craig A. James<br></div>Chief Te=
chnology Officer<br></div>eMolecules, Inc.<br></div><div>3430 Carmel Mounta=
in Road, Suite 250</div><div>San Diego, CA 92121<br></div>-----------------=
----------------<br></div></div></div></div>

--0000000000004b910c059a05cc9e--