> I've been shuffling thru the 'LIKE' code in pg, but whilst perusing, it
> occurred to me that I could use a function for this thing. Since i'm
> only looking at the first part of the string I use...
>
> SELECT * FROM info WHERE substring(street_name from 1 to 4) = 'MAIN'
>
> ...and the query com
I've been shuffling thru the 'LIKE' code in pg, but whilst perusing, it
occurred to me that I could use a function for this thing. Since i'm
only looking at the first part of the string I use...
SELECT * FROM info WHERE substring(street_name from 1 to 4) = 'MAIN'
...and the query completes in u
> CREATE INDEX nx_info1 ON info (lastname);
> CREATE INDEX nx_info2 ON info (street_name);
>
> The select is as simple as this in most cases...
>
> SELECT * FROM info WHERE street_name LIKE 'MAIN%';
>
> .,,the table about 50MB worth, about 70,000 records. I have an index on
> 'lastname' and 'st
The example you give, LIKE 'MAIN%', should be able to use the index, but I'm
not that expert on the internals of PostgreSQL. I was speaking from a general
knowledge of SQL. I was supposing you were trying to do something, such as,
LIKE '%BLVD%'. In this latter case, an index will bring you no bene
ned large
> enough to handle all the buffers... in this case, about 100 Meg.
>
> Phil Culberson
> DAT Services
>
> -Original Message-
> From: JB [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 06, 2000 5:52 PM
> To: Paul Condon
> Cc: [EMAIL PROTECTED]
> Subj
case, about 100 Meg.
Phil Culberson
DAT Services
-Original Message-
From: JB [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 06, 2000 5:52 PM
To: Paul Condon
Cc: [EMAIL PROTECTED]
Subject: Re: [GENERAL] 50 MB Table
Thanks for taking the time to reply. I think that I wasn't as clear as I
could
On Mon, 6 Mar 2000, JB wrote:
> [SNIP]
> CREATE TABLE info (
> lastname char(50),
> street_name char(50),
> street_number char(5),
> ... (a bunch of other stuff that works fine with '=')
> );
>
> CREATE INDEX nx_info1 ON info (lastname);
> CREATE INDEX nx_info2 ON info (street_name);
>
Thanks for taking the time to reply. I think that I wasn't as clear as I
could be. This table is normalized and as far as I understand, what I'm
doing with it is not extraordinary. The schema is basically...
CREATE TABLE info (
lastname char(50),
street_name char(50),
street_number char(5),
JB wrote:
> I have a 50 MB +- table in postgres. The data is normalized so there's
> not much I can do about the size. The tuples are about 512 bytes so
> there's a pile of 'em. I need searching on of several fields, a couple
> in particular are text fields that needs 'LIKE'. The problem is, the