Re: String manipulation

Поиск
Список
Период
Сортировка
От David Olbersen
Тема Re: String manipulation
Дата
Msg-id E7E213858379814A9AE48CA6754F5ECB0D7022@mail01.stbernard.com
обсуждение исходный текст
Ответ на String manipulation  ("Chad Thompson" <chad@weblinkservices.com>)
Ответы Re: String manipulation  (Joe Conway <mail@joeconway.com>)
Список pgsql-novice
Joe,

> SELECT substring(path from position(' ' in path) + 1)
> FROM (SELECT split_part( path, ':', 2 ) AS path FROM paths) AS ss;

That's cool enough except for the sub-select which would really slow down the query on a million+ row table. My
solutionis just reformatting data and doesn't add much if any over head to "SELECT path FROM paths". 

...but that's all speculation, am I right? I'd like to revise my thinking if I'm wrong.

--------------------------
David Olbersen
iGuard Engineer
St. Bernard Software
11415 West Bernardo Court
San Diego, CA 92127
1-858-676-2277 x2152


> -----Original Message-----
> From: Joe Conway [mailto:mail@joeconway.com]
> Sent: Monday, July 28, 2003 3:55 PM
> To: David Olbersen
> Cc: pgsql-novice
> Subject: Re: [NOVICE] String manipulation
>
>
> David Olbersen wrote:
> > I have an *UGLY* solution that might give you or others
> some ideas...
> >
> > SELECT
> >   substring(
> >     split_part( path, ':', 2 )
> >     from
> >     position( ' ' in split_part( path, ':', 2 ) ) + 1
> >   )
> > FROM paths;
> >
>
> That solution was pretty much what I was thinking. An alternative:
>
> SELECT substring(path from position(' ' in path) + 1)
> FROM (SELECT split_part( path, ':', 2 ) AS path FROM paths) AS ss;
>
> Joe
>
>

В списке pgsql-novice по дате отправления:

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: String manipulation
Следующее
От: Joe Conway
Дата:
Сообщение: Re: String manipulation