Optimizing t1.col like '%t2.col%' - Mailing list pgsql-performance

From Dan Kaplan
Subject Optimizing t1.col like '%t2.col%'
Date
Msg-id 00c801c87979$9f3da480$1d00a8c0@dan
Whole thread Raw
Responses Re: Optimizing t1.col like '%t2.col%'
List pgsql-performance

I’ve got a lot of rows in one table and a lot of rows in another table.  I want to do a bunch of queries on their join column.  One of these is like this: t1.col like '%t2.col%'

 

I know that always sucks.  I’m wondering how I can make it better.  First, I should let you know that I can likely hold both of these tables entirely in ram.  Since that’s the case, would it be better to accomplish this with my programming language?  Also you should know that in most cases, t1.col and t2.col is 2 words or less.  I’m not sure if that matters, I mention it because it may make tsearch2 perform badly.

 

pgsql-performance by date:

Previous
From: Bill Moran
Date:
Subject: Re: questions about CLUSTER
Next
From: "Dan Kaplan"
Date:
Subject: t1.col like '%t2.col%'