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 E02E953873 for ; Sun, 8 May 2005 13:24:55 -0300 (ADT) 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 96351-09 for ; Sun, 8 May 2005 16:24:47 +0000 (GMT) Received: from server07.icaen.uiowa.edu (server07.icaen.uiowa.edu [128.255.17.47]) by svr1.postgresql.org (Postfix) with ESMTP id 7196752AA9 for ; Sun, 8 May 2005 13:24:46 -0300 (ADT) Received: from server11.icaen.uiowa.edu (server11.icaen.uiowa.edu [128.255.17.51]) by server07.icaen.uiowa.edu (8.13.3/8.12.9) with ESMTP id j48GOiTT006770; (envelope-from ) Sun, 8 May 2005 11:24:44 -0500 (CDT) Received: from [192.168.1.11] (12-215-118-172.client.mchsi.com [12.215.118.172]) (authenticated user=jfmeinel) by server11.icaen.uiowa.edu (8.13.2/smtp-serv-1.7) with ESMTP id j48GOeDI007216 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256); (envelope-from ) Sun, 8 May 2005 11:24:44 -0500 (CDT) Message-ID: <427E3D44.4080503@arbash-meinel.com> Date: Sun, 08 May 2005 11:24:36 -0500 From: John A Meinel User-Agent: Mozilla Thunderbird 1.0.2-1.3.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeroen van Iddekinge Cc: pgsql-performance@postgresql.org Subject: Re: sequence scan on PK References: <427E2941.9070105@lycos.com> <427E17BC.7050407@arbash-meinel.com> <427E5130.7020702@lycos.com> In-Reply-To: <427E5130.7020702@lycos.com> X-Enigmail-Version: 0.89.6.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig54424BC0B47EE0772AF1F676" X-Virus-Scanned: ClamAV version 0.83, clamav-milter version 0.83 on clamav.icaen.uiowa.edu X-Virus-Scanned: ClamAV version 0.83, clamav-milter version 0.83 on clamav.icaen.uiowa.edu X-Virus-Status: Clean 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: 200505/79 X-Sequence-Number: 12243 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig54424BC0B47EE0772AF1F676 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Jeroen van Iddekinge wrote: > >> >> You could tweak with several settings to get it to do an index scan >> earlier, but these would probably break other queries. You don't need to >> tune for 100 rows, morelike 100k or 100M. > > > Thanks for respone. > The index scan was a little bit faster for id=1 and faster for id=99. > > Which settings shoud I change for this? cpu_index_tuple_cost , > cpu_operator_cost, cpu_tuple_cost? > > > Jer. Well, I would start with *don't*. You are only looking at one query, which is pretty much fast already, and probably is not going to be the bottleneck. You are optimizing the wrong thing. That being said, because you have everything cached in ram (since it is a tiny table), you probably would set random_page_cost = 2. In theory it should really never be lower than 2, though if you are trying to force an index scan you can do it. John =:-> --------------enig54424BC0B47EE0772AF1F676 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFCfj1HJdeBCYSNAAMRAkUHAJ9jusMa60Ju+Mg4g5OcAaYqVuZLdgCfbftl LcIWwQ7oQGtjG0ThSLqvVsg= =9AY8 -----END PGP SIGNATURE----- --------------enig54424BC0B47EE0772AF1F676--