Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id NAA98237 for ; Sun, 21 May 2000 13:58:35 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id NAA09919; Sun, 21 May 2000 13:58:15 -0400 (EDT) To: "Mitch Vincent" cc: pgsql-sql@postgresql.org Subject: Re: Full text indexing (and errors!) In-reply-to: <00db01bfc345$e5400100$0300000a@doot.org> References: <00db01bfc345$e5400100$0300000a@doot.org> Comments: In-reply-to "Mitch Vincent" message dated "Sun, 21 May 2000 12:59:14 -0400" Date: Sun, 21 May 2000 13:58:14 -0400 Message-ID: <9916.958931894@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200005/95 "Mitch Vincent" writes: > I have 2 tables. > Table "applicants_resumes" > Attribute | Type | Modifier > -------------+---------+---------- > app_id | integer | > resume_text | text | > Index: resumes_oid_index Uh, the query you show below is on "applicants" not on this table ... is there an index on applicants' OID column? > ... As you can see, really really slow. So I thought baout creating an index > on 'string' in resumes_fti (makes since as this is suppose to be a full text > index) -- Note that's not listed in the README which was very odd to > me. Isn't that what resume_fti_index is? > ipa=# CREATE INDEX "rstring_fti_index" on resumes_fti(lower(string)); > FATAL 1: Memory exhausted in AllocSetAlloc() lower(text) leaks memory, so I guess this would happen with a large enough table :-(. There are plans afoot to improve matters in 7.1 ... However, since fti.c lowercases everything it puts into the fti table, I don't see a need for doing another lower() operation in the index definition. As far as I can tell, you're already OK on the string search, since you are getting an indexscan on resumes_fti. The hash join might not be such a bright idea though. I suspect the reason for that choice is the large estimate for the number of rows matched by the f1.string ~ '^engineer' condition (168041 which seems like a lot). How big are these tables really? Have you done a 'vacuum analyze' on them? regards, tom lane