Re: [HACKERS] Re: indexing words slow - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Re: indexing words slow
Date
Msg-id 199803140640.BAA04556@candle.pha.pa.us
Whole thread Raw
In response to Re: indexing words slow  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
> Second, CLUSTER takes forever because it is moving all over the disk
> retrieving each row in order.
>

> So, to your solution.  CLUSTER is too slow.  The disk is going crazy
> moving single rows into the temp table.  I recommend doing a COPY of
> artist_fti to a flat file, doing a Unix 'sort' on the flat file, then
> re-loading the data into the artist_fti, and then putting the index on
> the table and vacuum.
>
> I have done this, and now all searches are instantaneous THE FIRST TIME
> and every time.
>
> With this change, I am anxious to hear how fast you can now do your
> multi-word searches.  Daily changes will not really impact performance
> because they are a small part of the total search, but this process of
> COPY/sort/reload/reindex will need to be done on a regular basis to
> maintain performance.

One more piece of good news.  The reason CLUSTER was so slow is because
you loaded massive unordered amounts of data into the system.  Once you
do the COPY out/reload, subsequent clusters will run very quickly,
because 99% of the data is already ordered.  Only the new/changed data
is unordered, so you should be able to rapidly run CLUSTER from then on
to keep good performance.

I think a user module allowing this word fragment searching will be a
big hit with users.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: Edmund Mergl
Date:
Subject: Re: [HACKERS] postgre install/perl interf
Next
From: dg@illustra.com (David Gould)
Date:
Subject: Re: [HACKERS] RVM -- recoverable virtual memory