X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7A0C9539DD for ; Fri, 1 Apr 2005 11:05:50 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 50613-05 for ; Fri, 1 Apr 2005 10:05:41 +0000 (GMT) Received: from michael.eatserver.nl (michael.eatserver.nl [212.203.14.103]) by svr1.postgresql.org (Postfix) with ESMTP id 680105379A for ; Fri, 1 Apr 2005 11:05:40 +0100 (BST) Received: from linux (82-168-44-140-bbxl.xdsl.tiscali.nl [82.168.44.140]) (authenticated bits=0) by michael.eatserver.nl (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id j31ABpQW032394 for ; Fri, 1 Apr 2005 12:11:51 +0200 From: "H.J. Sanders" To: Subject: date - range Date: Fri, 1 Apr 2005 12:05:44 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Importance: Normal X-Virus-Scanned: by amavisd-new X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200504/4 X-Sequence-Number: 11401 Anybody a solution for the next problem: people can subscribe to a service for 1 or more days (upto a max. of 365). So in the database is stored: first_date and last_date To select which people are subscribed for a certain date (e.g. today) we use a select like select ....... where first_date <= today and last_date >= today Whatever index we create system always does a sequential scan (which I can understand). Has someone a smarter solution? All suggestions will be welcomed.