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 9D35D3A3D55 for ; Tue, 16 Nov 2004 16:21:26 +0000 (GMT) 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 90655-03 for ; Tue, 16 Nov 2004 16:21:24 +0000 (GMT) Received: from mailer.elma.loc (mail.elma.fr [213.41.14.138]) by svr1.postgresql.org (Postfix) with ESMTP id 0DD5A3A3CA4 for ; Tue, 16 Nov 2004 16:21:21 +0000 (GMT) Received: from mailer.elma.loc (localhost [127.0.0.1]) by localhost (Postfix) with ESMTP id 26000EC20D; Tue, 16 Nov 2004 17:24:33 +0100 (CET) Received: from zoot.elma.loc (herve.elma.fr [10.0.1.2]) by mailer.elma.loc (Postfix) with ESMTP id 05C89EC113; Tue, 16 Nov 2004 17:24:33 +0100 (CET) From: =?iso-8859-15?q?Herv=E9_Piedvache?= Organization: Elma =?iso-8859-15?q?Ing=E9nierie?= Informatique To: "Joshua D. Drake" Subject: Re: Tsearch2 really slower than ilike ? Date: Tue, 16 Nov 2004 17:21:18 +0100 User-Agent: KMail/1.7.1 Cc: pgsql-performance@postgresql.org References: <200411161555.59144.herve@elma.fr> <419A2581.2050409@commandprompt.com> In-Reply-To: <419A2581.2050409@commandprompt.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200411161721.18840.herve@elma.fr> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/228 X-Sequence-Number: 9182 Le Mardi 16 Novembre 2004 17:06, Joshua D. Drake a écrit : > > QUERY PLAN > >-------------------------------------------------------------------------- > >-------------------------------------- Seq Scan on site_rss s > > (cost=0.00..11863.16 rows=295 width=158) (actual time=17.414..791.937 > > rows=12 loops=1) > > Filter: (site_name ~~* '%atari%'::text) > > SubPlan > > -> Seq Scan on user_choice u (cost=0.00..3.46 rows=1 width=4) > > (actual time=0.222..0.222 rows=0 loops=12) > > Filter: ((id_site = $0) AND (id_user = 1)) > > Total runtime: 792.099 ms > > > >First time I run the request I have a result in about 789 miliseconds > > !!??? > > > >I'm using PostgreSQL v7.4.6 with a Bi-Penitum III 933 Mhz and 1 Gb of RAM. > > > >Any idea ... ? For the moment I'm going back to use the ilike solution ... > > but I was really thinking that Tsearch2 could be a better solution ... > > Well I would be curious about what happens the second time you run the > query. > The first time is kind of a bad example because it has to push the index > into ram. The second time is really quicker yes ... about 312 miliseconds ... But for each search I have after it take about 3 or 4 seconds ... So what can I do ? Regards, -- Hervé Piedvache Elma Ingénierie Informatique 6 rue du Faubourg Saint-Honoré F-75008 - Paris - France Pho. 33-144949901 Fax. 33-144949902