Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 53AC913381A5 for ; Mon, 9 May 2011 16:19:14 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 70212-04-2 for ; Mon, 9 May 2011 19:19:07 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mail.postgresql.org (Postfix) with ESMTP id AA09D1337E2B for ; Mon, 9 May 2011 16:11:04 -0300 (ADT) Received: by wwc33 with SMTP id 33so5553475wwc.19 for ; Mon, 09 May 2011 12:11:03 -0700 (PDT) Received: by 10.216.58.207 with SMTP id q57mr734285wec.63.1304968263683; Mon, 09 May 2011 12:11:03 -0700 (PDT) Received: from mptpmbp.local (108-135.77-83.cust.bluewin.ch [83.77.135.108]) by mx.google.com with ESMTPS id n52sm3174449wer.24.2011.05.09.12.11.01 (version=SSLv3 cipher=OTHER); Mon, 09 May 2011 12:11:02 -0700 (PDT) Message-ID: <4DC83C44.5070206@engene.se> Date: Mon, 09 May 2011 21:11:00 +0200 From: Marcus Engene User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.16) Gecko/20101125 Thunderbird/3.0.11 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: wildcard makes seq scan on prod db but not in test References: <4DC82D28.7020105@engene.se> <4DC7F2B3020000250003D424@gw.wicourts.gov> In-Reply-To: <4DC7F2B3020000250003D424@gw.wicourts.gov> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201105/81 X-Sequence-Number: 43590 On 5/9/11 8:57 , Kevin Grittner wrote: > > That could be a difference is collations. What do you get from the > query on this page for each database?: > > http://wiki.postgresql.org/wiki/Server_Configuration > > -Kevin > > There's indeed a different collation. Why is this affecting? Can i force a column to be ascii? The (fast) test server: version | PostgreSQL 9.0.4 on x86_64-apple-darwin10.7.0, compiled by GCC i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664), 64-bit effective_cache_size | 512MB lc_collate | C lc_ctype | UTF-8 maintenance_work_mem | 128MB max_connections | 100 max_stack_depth | 2MB port | 5435 server_encoding | UTF8 shared_buffers | 512MB temp_buffers | 8192 TimeZone | Europe/Zurich wal_buffers | 1MB work_mem | 128MB (14 rows) The (slow) production server: version | PostgreSQL 9.0.4 on x86_64-unknown-linux-gnu, compiled by GCC gcc (Debian 4.3.2-1.1) 4.3.2, 64-bit checkpoint_completion_target | 0.9 checkpoint_segments | 64 effective_cache_size | 48GB lc_collate | en_US.UTF-8 lc_ctype | en_US.UTF-8 listen_addresses | localhost,10.0.0.3,74.50.57.76 maintenance_work_mem | 1GB max_connections | 600 max_stack_depth | 2MB port | 5435 server_encoding | UTF8 shared_buffers | 8GB temp_buffers | 32768 TimeZone | UTC work_mem | 128MB (16 rows) Thanks, Marcus