pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dan Kaplan <dkaplan@citizenhawk.com>
To: pgsql-performance@postgresql.org
Subject: t1.col like '%t2.col%'
Date: Wed, 27 Feb 2008 11:19:22 -0800
Message-ID: <00c001c87975$a907e2e0$1d00a8c0@dan> (raw)

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.

view thread (7+ messages)  latest in thread

Message-ID: <00c001c87975$a907e2e0$1d00a8c0@dan>
Permalink:  ../00c001c87975$a907e2e0$1d00a8c0@dan/
Also on:    postgresql.org/message-id/00c001c87975$a907e2e0$1d00a8c0@dan

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: dkaplan@citizenhawk.com
  Subject: Re: t1.col like '%t2.col%'
  In-Reply-To: <00c001c87975$a907e2e0$1d00a8c0@dan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox