Received: from bjke.com (firewall-user@ganymede.bjke.com [144.210.8.38]) by hub.org (8.9.1/8.9.1) with ESMTP id LAA26048 for ; Wed, 20 Jan 1999 11:15:43 -0500 (EST) (envelope-from djackson@cpsgroup.com) Received: by bjke.com; id KAA26323; Wed, 20 Jan 1999 10:15:41 -0600 (CST) Received: from cpsmail.cpsgroup.com(144.210.12.11) by gauntlet.bjke.com via smap (4.1) id xmaa25340; Wed, 20 Jan 99 10:14:38 -0600 Received: by cpsmail with Internet Mail Service (5.0.1458.49) id ; Wed, 20 Jan 1999 10:17:24 -0600 Message-ID: From: "Jackson, DeJuan" To: Frank Morton , pgsql-sql@postgreSQL.org Subject: RE: [SQL] Faster LIKE Date: Wed, 20 Jan 1999 10:17:21 -0600 X-Priority: 3 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1458.49) Content-Type: text/plain > I have an image database with keywords assigned to each record > in the field "keywords" and often do: > > select * from images where keywords like 'dog'; > > which works great with a small database, but slows down quickly > with a large database. > > since the "keywords" field can have multiple entries, such as > 'dog mammals fuzzy small' I was considering creating a separate > keywords table where each word was an individual row and could > therefore be indexed and fast. > > however, in the above example, I would like to match on "mammal" > also (i.e., no "s" on the end) or any substring within the field, so > the separate table does not do it either. > > This has to be a common thing. Are there any good solutions or > research out there to solve this problem? Thanks. See: pgsql/contrib/fulltextindex Hope this helps, -DEJ