pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pavel Mamin <pm@sky.ru>
To: pgsql-sql@postgreSQL.org
Date: Wed, 15 Sep 1999 16:11:50 +0600
Message-ID: <3674.990915@sky.ru> (raw)

Please, help me.

For example, I have a table
> create table tab1
> (field1 int4 primary key, field2 int4, field3 int4);

.. and I want to make the next query:
> select field1, field2, field3
> from tab1
> where field2=<some value>
> order by field3;

What indexes I have to make?
Either:
> create index idx1 on tab1 (field2, field3);
Or:
> create index idx1 on tab1 (field2);
> create index idx2 on tab1 (field3);
Or something else?

Pavel Mamin,
Network Programmer,
SkyNet Co. ISP, Yekaterinburg, Russia





view thread (2+ messages)  latest in thread

Message-ID: <3674.990915@sky.ru>
Permalink:  ../3674.990915@sky.ru/
Also on:    postgresql.org/message-id/3674.990915@sky.ru

 · 

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-sql@postgresql.org
  Cc: pm@sky.ru
  Subject: Re: 
  In-Reply-To: <3674.990915@sky.ru>
  References: <3674.990915@sky.ru>

* 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