X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 9807030ECCE for ; Mon, 16 Jun 2003 22:45:39 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 72189-03 for ; Mon, 16 Jun 2003 19:45:29 -0300 (ADT) Received: from flake.decibel.org (flake.decibel.org [66.143.173.58]) by svr1.postgresql.org (Postfix) with SMTP id ABD2F30EF71 for ; Mon, 16 Jun 2003 19:45:28 -0300 (ADT) Received: (qmail 48205 invoked by uid 1001); 16 Jun 2003 22:45:27 -0000 Date: Mon, 16 Jun 2003 17:45:27 -0500 From: "Jim C. Nasby" To: pgsql-performance@postgresql.org Subject: Re: sequential scans on few columns tables Message-ID: <20030616224527.GM40542@flake.decibel.org> Reply-To: jim@nasby.net References: <3EEE1F54.3030507@klaster.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3EEE1F54.3030507@klaster.net> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.8-RELEASE i386 X-Distributed: Join the Effort! http://www.distributed.net X-Archive-Number: 200306/105 X-Sequence-Number: 2189 On Mon, Jun 16, 2003 at 09:49:40PM +0200, Tomasz Myrta wrote: > by denormalizing tables. Let's say we have table "users" which we split > into 1:1 relation "users_header" and "users_data". We put searchable > columns into users_header and rest of them into users_data. users_data > have some integer foreign key referencing to users_header. > > What do you think about it? Does the Postgres use advantages of small > table users_header? Sequential scan on memory cached table should speed > up queries, the rest columns are in integer-indexed table which > shouldn't slow it down. Keep in mind that pgsql has a pretty heafty per-row overhead of 23 bytes. If your data table has a bunch of big varchars then it might be worth it, otherwise it might not be. -- Jim C. Nasby (aka Decibel!) jim@nasby.net Member: Triangle Fraternity, Sports Car Club of America Give your computer some brain candy! www.distributed.net Team #1828 Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming, or what?"