X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E4687D9E6C for ; Wed, 21 Sep 2005 19:04:02 -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 13377-08 for ; Wed, 21 Sep 2005 22:03:56 +0000 (GMT) Received: from ki-communication.com (unknown [202.147.194.21]) by svr1.postgresql.org (Postfix) with ESMTP id 5B6E9D9E65 for ; Wed, 21 Sep 2005 19:03:50 -0300 (ADT) Received: from iacn01wks ([192.168.0.128]) by ki-communication.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 22 Sep 2005 05:08:11 +0700 From: "Ahmad Fajar" To: Subject: tsearch2 seem very slow Date: Thu, 22 Sep 2005 05:08:12 +0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0000_01C5BF33.A16E12B0" X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Thread-Index: AcW++PT0wRKS88YrQZGbHiQZ6k4XsQ== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Message-ID: X-OriginalArrivalTime: 21 Sep 2005 22:08:11.0656 (UTC) FILETIME=[F4B47080:01C5BEF8] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.001 required=5 tests=[HTML_MESSAGE=0.001] X-Spam-Level: X-Archive-Number: 200509/273 X-Sequence-Number: 14581 This is a multi-part message in MIME format. ------=_NextPart_000_0000_01C5BF33.A16E12B0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I have about 419804 rows in my article table. I have installed tsearch2 and its gist index correctly. My table structure is: CREATE TABLE tbarticles ( articleid int4 NOT NULL, title varchar(250), mediaid int4, datee date, content text, contentvar text, mmcol float4 NOT NULL, sirkulasi float4, page varchar(10), tglisidata date, namapc varchar(12), usere varchar(12), file_pdf varchar(255), file_pdf2 varchar(50), kolom int4, size_jpeg int4, journalist varchar(120), ratebw float4, ratefc float4, fti tsvector, CONSTRAINT pk_tbarticles PRIMARY KEY (articleid) ) WITHOUT OIDS; Create index fti_idx1 on tbarticles using gist (fti); Create index fti_idx2 on tbarticles using gist (datee, fti); But when I search something like: Select articleid, title, datee from tbarticles where fti @@ to_tsquery('susilo&bambang&yudhoyono&jusuf&kalla'); It takes about 30 sec. I run explain analyze and the index is used correctly. Then I try multi column index to filter by date, and my query something like: Select articleid, title, datee from tbarticles where fti @@ to_tsquery('susilo&bambang&yudhoyono&jusuf&kalla') and datee >= '2002-01-01' and datee <= current_date An it still run about 25 sec. I do run explain analyze and my multicolumn index is used correctly. This is not acceptable if want to publish my website if the search took very longer. I have run vacuum full analyze before doing such query. What going wrong with my query?? Is there any way to make this faster? I have try to tune my postgres configuration, but it seem helpless. My linux box is Redhat 4 AS, and the hardware: 2 GB RAM DDR 400, 2x200 GB Serial ATA 7200RPM and configure as RAID0 (just for postgres data), my sistem run at EIDE 80GB 7200 RPM. Please.help.help. ------=_NextPart_000_0000_01C5BF33.A16E12B0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I have about 419804 rows in my article table. I have installed tsearch2 and its gist index correctly. =

My table structure is:

CREATE TABLE tbarticles

(

  articleid int4 NOT = NULL,

  title = varchar(250),

  mediaid int4,

  datee date,

  content text,

  contentvar text,

  mmcol float4 NOT = NULL,

  sirkulasi float4,

  page varchar(10),

  tglisidata date,

  namapc = varchar(12),

  usere = varchar(12),

  file_pdf = varchar(255),

  file_pdf2 = varchar(50),

  kolom int4,

  size_jpeg int4,

  journalist = varchar(120),

  ratebw float4,

  ratefc float4,

  fti tsvector,

  CONSTRAINT pk_tbarticles PRIMARY KEY = (articleid)

) WITHOUT OIDS;

Create index fti_idx1 on tbarticles using gist = (fti);

Create index fti_idx2 on tbarticles using gist = (datee, fti);

 

But when I search something = like:

Select articleid, title, datee from tbarticles where = fti @@ to_tsquery(‘susilo&bambang&yudhoyono&jusuf&kalla= 217;);

It takes about 30 sec. I run explain analyze and the = index is used correctly.

 

Then I try multi column index to filter by date, and = my query something like:

Select articleid, title, datee from tbarticles where = fti @@ to_tsquery(‘susilo&bambang&yudhoyono&jusuf&kalla= 217;) and datee >=3D '2002-01-01' and datee <=3D = current_date

An it still run about 25 sec. I do run explain = analyze and my multicolumn index is used correctly.

This is not acceptable if want to publish my website = if the search took very longer.

 

I have run vacuum full analyze before doing such = query. What going wrong with my query?? Is there any way to make this = faster?

I have try to tune my postgres configuration, but it = seem helpless. My linux box is Redhat 4 AS, and

the hardware: 2 GB RAM DDR 400, 2x200 GB Serial ATA = 7200RPM and configure as RAID0 (just for postgres data), my sistem run at EIDE 80GB = 7200 RPM.

 

Please…help…help…<= /font>

------=_NextPart_000_0000_01C5BF33.A16E12B0--