Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VyoXO-0005qM-0U for pgsql-sql@arkaria.postgresql.org; Thu, 02 Jan 2014 20:06:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VyoXN-0004ww-Cn for pgsql-sql@arkaria.postgresql.org; Thu, 02 Jan 2014 20:06:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VyoXL-0004vc-Ru for pgsql-sql@postgresql.org; Thu, 02 Jan 2014 20:06:35 +0000 Received: from mail-qa0-f50.google.com ([209.85.216.50]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VyoXJ-0004Ji-CQ for pgsql-sql@postgresql.org; Thu, 02 Jan 2014 20:06:35 +0000 Received: by mail-qa0-f50.google.com with SMTP id i13so13690325qae.9 for ; Thu, 02 Jan 2014 12:06:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=rDEPpBThUbfN/iSzPmlJKxYXyDnA+i3L4lHjWyw1h/k=; b=UcLMoYC+MhsZTkW+QGD/0D5PtTPo6wHt+GH/PgMOazMtFvU4WTZIbXL0r7wTqHjocm 8aNOJ0a2TnnpMK4tAkiRSIM3Jqt+09uedCA+CW/AKRlJ47qym6nku6h198AgTmAl1vWb 2XbjPnf8NdsVJ60b53UDjnywLqyFkl9WOQE+Ld1DayV67F6BSFNoq4xITJe2ojjQl820 qEH0MA6/irBylWu3gp2F1vmn0YhfplxruBJ+5u4IRw8EhOBDlbqtBKZRe13UcJWjspMP BhYn6wXIh18UEFPClC2zJNRMUHd9MuB4kpwvACt/Sg2Ys8lDSvK0wqCdS/Z4yTQ91iKy vTMw== X-Gm-Message-State: ALoCoQlKHukTn2L/Z6HoxeB2qlKyTSavlMFltqfsmLtkgiEmLNXicQ7817oboRG87y+richmAYAs X-Received: by 10.49.2.132 with SMTP id 4mr144099719qeu.15.1388693191647; Thu, 02 Jan 2014 12:06:31 -0800 (PST) Received: from [10.0.0.28] (pool-108-6-136-93.nycmny.fios.verizon.net. [108.6.136.93]) by mx.google.com with ESMTPSA id d1sm82005220qai.7.2014.01.02.12.06.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 Jan 2014 12:06:30 -0800 (PST) Subject: Re: Index on multiple columns VS multiple index Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=iso-8859-1 From: "Jonathan S. Katz" In-Reply-To: Date: Thu, 2 Jan 2014 15:06:28 -0500 Cc: "pgsql-sql@postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <260BFF81-D9DB-4A71-9D17-2BD7C1F4C343@excoventures.com> <97DDB603-D01D-4355-872A-5913DBBC5268@excoventures.com> To: =?iso-8859-1?Q?Brice_Andr=E9?= X-Mailer: Apple Mail (2.1283) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org On Jan 2, 2014, at 3:00 PM, Brice Andr=E9 wrote: > But I have still one question that remains :=20 >=20 > suppose I define an index on ('a', 'b') columns, will it be useful for a = search on 'a' column only, or will it be ignore by postgresl ? If you define the index on ('a', 'b') in that order and are just searching = for 'a' in your query, the query planner will use the index. Jonathan --=20 Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql