Skip site navigation (1) Skip section navigation (2)

Re: select with "like" from another table

From: "chris smith" <dmagick(at)gmail(dot)com>
To: "Anton Maksimenkov" <anton200(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: select with "like" from another table
Date: 2006-05-29 10:36:43
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
On 5/29/06, Anton Maksimenkov <anton200(at)gmail(dot)com> wrote:
> Hi.
> I have 2 tables - one with calls numbers and another with calls codes.
> The structure almost like this:

How long does this query take?

SELECT code FROM a_voip_codes c, a_voip v where v.called_station_id
like c.code ||
'%' order by code desc limit 1

I wonder if you'll benefit from an index on a_voip(called_station_id)
to speed up this join.

Postgresql & php tutorials

In response to


pgsql-performance by date

Next:From: Markus SchaberDate: 2006-05-29 11:11:13
Subject: Re: Getting even more insert performance (250m+rows/day)
Previous:From: Anton MaksimenkovDate: 2006-05-29 09:53:24
Subject: select with "like" from another table

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group