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 8A5533A4FC4 for ; Sun, 23 Jan 2005 03:18:09 +0000 (GMT) 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 46111-06 for ; Sun, 23 Jan 2005 03:17:58 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id C455E3A3F0C for ; Sun, 23 Jan 2005 03:18:01 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j0N3I0co026466; Sat, 22 Jan 2005 22:18:00 -0500 (EST) To: "Jim C. Nasby" Cc: pgsql-performance@postgresql.org Subject: Re: Odd number of rows expected In-reply-to: <20050121203827.GW67721@decibel.org> References: <20050121203827.GW67721@decibel.org> Comments: In-reply-to "Jim C. Nasby" message dated "Fri, 21 Jan 2005 14:38:27 -0600" Date: Sat, 22 Jan 2005 22:18:00 -0500 Message-ID: <26465.1106450280@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/416 X-Sequence-Number: 10106 "Jim C. Nasby" writes: > (SELECT b.bucket_id AS rrs_bucket_id, s.* > FROM rrs.bucket b > JOIN page_log.log s > ON ( > b.prev_end_time < log_time > AND b.end_time >= log_time ) > WHERE b.rrs_id = '1' > AND b.end_time <= '2005-01-21 20:23:00+00' > AND b.end_time > '1970-01-01 00:00:00+00' > ) a > Basically, it seems that it doesn't understand that each row in log will > match up with at most one row in bucket. There is a unique index on > bucket(rrs_id, end_time), so it should be able to tell this. Why should it be able to tell that? regards, tom lane