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 49AD330E35D for ; Mon, 16 Jun 2003 19:49:34 +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 91267-01 for ; Mon, 16 Jun 2003 16:49:23 -0300 (ADT) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by svr1.postgresql.org (Postfix) with ESMTP id 879F030D17A for ; Mon, 16 Jun 2003 16:49:23 -0300 (ADT) Received: from klaster.net (tv126.internetdsl.tpnet.pl [80.55.125.126]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 4F3E52B3D0 for ; Mon, 16 Jun 2003 21:49:13 +0200 (CEST) Message-ID: <3EEE1F54.3030507@klaster.net> Date: Mon, 16 Jun 2003 21:49:40 +0200 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: sequential scans on few columns tables Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200306/95 X-Sequence-Number: 2179 Hi Recently I was wondering about tables difficult to index. Example - queries with "ilike" where clauses. Without additional contrib modules the only way to search such tables is sequential scan (am I right?) The point is too keep these tables as small as possible. We can do this 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. These example above is ony an idea, I don't have currently any example for it. Regards, Tomasz Myrta