X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id C54D5D1B54F for ; Wed, 1 Oct 2003 17:38:10 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 84484-02 for ; Wed, 1 Oct 2003 14:37:24 -0300 (ADT) Received: from mail.hive.nj2.inquent.com (mc.carriermail.com [205.178.180.9]) by svr1.postgresql.org (Postfix) with SMTP id 5DDCBD1B4E5 for ; Wed, 1 Oct 2003 14:37:23 -0300 (ADT) Received: (qmail 19823 invoked from network); 1 Oct 2003 17:37:38 -0000 Received: from unknown (HELO ?10.0.2.7?) (216.208.117.7) by 205.178.180.9 with SMTP; 1 Oct 2003 17:37:38 -0000 Subject: Re: Optimizing >= and <= for numbers and dates From: Rod Taylor To: Dimitri Nagiev Cc: Postgresql Performance In-Reply-To: <24741.1065029447@www60.gmx.net> References: <24741.1065029447@www60.gmx.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-zuPSl545AakUU0rt42yb" Message-Id: <1065029881.85344.138.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 01 Oct 2003 13:38:02 -0400 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/27 X-Sequence-Number: 3775 --=-zuPSl545AakUU0rt42yb Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2003-10-01 at 13:30, Dimitri Nagiev wrote: > Hi all, >=20 > I haven't found any official documentation about the postgres sql optimiz= er > on the web, so please forgive me if there is such a document and point me= to > the right direction. >=20 > I've got the following problem: I cannot make the postgres SQL Optimizer = use > an index on a date field to filter out a date range, e.g. >=20 > select * from mytable where mydate >=3D '2003-10-01'; >=20 > Seq Scan on mytable (cost=3D0.00..2138.11 rows=3D12203 width=3D543) > Filter: (mydate >=3D '2003-09-01'::date) EXPLAIN ANALYZE output please. --=-zuPSl545AakUU0rt42yb Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQA/exD56DETLow6vwwRArBBAJ9+A8EnmV4yp6jFzlHa95G4jsVDpgCeKxxv tD2P2Io1t7eEU47WUtjPVfw= =xbyL -----END PGP SIGNATURE----- --=-zuPSl545AakUU0rt42yb--