X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id 2E14ED1C7F1; Tue, 22 Jul 2003 17:48:29 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 92251-03; Tue, 22 Jul 2003 17:48:18 +0000 (GMT) Received: from pns.mm.eutelsat.org (pns.mm.eutelsat.org [194.214.173.227]) by svr1.postgresql.org (Postfix) with ESMTP id 505A4D1C4BF; Tue, 22 Jul 2003 14:48:17 -0300 (ADT) Received: from nts-03.mm.eutelsat.org (localhost [127.0.0.1]) by pns.mm.eutelsat.org (8.11.6/linuxconf) with ESMTP id h6MHq0S24908; Tue, 22 Jul 2003 19:52:01 +0200 Received: from GMENDOLA2 (gmendola2.mm.eutelsat.org [194.214.173.26]) by nts-03.mm.eutelsat.org (8.11.6/linuxconf) with SMTP id h6MHjQR15349; Tue, 22 Jul 2003 19:45:26 +0200 Message-ID: <00ee01c35079$707a6440$152aa8c0@GMENDOLA2> From: "Mendola Gaetano" To: , , References: <00c101c35074$1e5f5b20$152aa8c0@GMENDOLA2> <200307221040.28653.josh@agliodbs.com> Subject: Re: [PERFORM] Wrong plan or what ? Date: Tue, 22 Jul 2003 19:48:20 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/214 X-Sequence-Number: 9554 "Josh Berkus" > Gaetano, > > > SELECT * from user_logs where id_user in ( > > 10943, 10942, 10934, 10927, 10910, 10909 > > ); > > [SNIPPED] > > > Why the planner or the executor ( I don't know ) do not follow > > the same strategy ? > > It is, actually, according to the query plan. > > Can you post the EXPLAIN ANALYZE for the above query? Index Scan using idx_user_user_logs, idx_user_user_logs, idx_user_user_logs, idx_user_user_logs, idx_user_user_logs, idx_user_user_logs on user_logs (cost=0.00..5454.21 rows=2498 width=48) (actual time=0.09..0.28 rows=10 loops=1) Index Cond: ((id_user = 10943) OR (id_user = 10942) OR (id_user = 10934) OR (id_user = 10927) OR (id_user = 10910) OR (id_user = 10909)) Total runtime: 0.41 msec (3 rows) Thank you Gaetano PS: if I execute the query I obtain 10 rows instead of 3 that say the explain analyze.