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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: select with "like" from another table



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
http://www.designmagick.com/



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2007 PostgreSQL Global Development Group