[ADMIN] "like" and index

2009-02-25 Thread Tony Liao
hi all, I have a table table_A (id serial,prefix varchar),for example. now I want to get the id of "johnsmith"'s prefix match table_A.prefix,so I do select id from table_A where 'johnsmith' like prefix||'%' ,the table_A is very large so I would like to make index. create table_A_index

Re: [ADMIN] "like" and index

2009-02-25 Thread Tony Liao
2009/2/25 Michael Monnerie > On Mittwoch 25 Februar 2009 Tony Liao wrote: > > hi all, > > I have a table table_A (id serial,prefix varchar),for example. > > now I want to get the id of "johnsmith"'s prefix match > > table_A.prefix,so I do sel

Re: [ADMIN] "like" and index

2009-02-25 Thread Tony Liao
index of gist_prefix_range_ops,not found! I can insert the column prefix with type prefix_range. ps : doest it work in C local,or uft8? 2009/2/26 Harald Fuchs > In article <8f750b7c0902250259w6065515as350aca3b5d7d8...@mail.gmail.com>, > Tony Liao writes: > > >

Re: [ADMIN] "like" and index

2009-02-25 Thread Tony Liao
hi Harald, I reboot the machine and create index,it works.thanks. 2009/2/26 Harald Fuchs > In article <8f750b7c0902250259w6065515as350aca3b5d7d8...@mail.gmail.com>, > Tony Liao writes: > > > hi all, > > I have a table table_A (id serial,prefix varchar),f

[ADMIN] String concatenation work in version 8.2.11 and 8.3.6

2009-02-26 Thread Tony Liao
hi,all for example tableA create table tableA ( id serial, a integer, b integer, c integer ); insert into tableA (a,b,c) values (12,34,56); then, select id from tableA where (a||b||c)=123456; in postgresql version 8.2.11,it works.

Re: [ADMIN] String concatenation work in version 8.2.11 and 8.3.6

2009-02-26 Thread Tony Liao
clients of your > database... > > Tony Liao rašė: > > hi,all >> for example tableA >> create table tableA ( >> id serial, >> a integer, >> b integer, >> c integer >> ); >> insert into tableA (a,b,

[ADMIN] index for inet(ip address or ip range)

2009-02-26 Thread Tony Liao
hello,everybody I want to create index for column ip1 and ip2.I know there is a contrib name ip4r.but the column ip1(ip2) would be a ip address or ip range. The query would do select ... where ip1>>='96.168.65.84' or ip2>>='96.168.65.84'. does anyone have ideas?

Re: [ADMIN] index for inet(ip address or ip range)

2009-02-26 Thread Tony Liao
hi,lee CIDR is only accept ipv4 but not ip range such as 192.168.1.0/24. INET type is what I need,but I don't know how to create index. does anyone have ideas? 2009/2/27 Lee Azzarello > On Thu, Feb 26, 2009 at 5:33 AM, Tony Liao wrote: > > h

[ADMIN] multi-threading access problem

2009-03-06 Thread Tony Liao
I should adjust system performance,but how? anyone can help me? thanks. Tony Liao

[ADMIN] how to do prefix_range default value?

2009-04-02 Thread Tony Liao
hi,all I have installed prefix contrib,it works well. now I want to insert default value [] to prefix column,because if the prefix column is NULL,the returns are not I want (with prefix @>'text').I alter column prefix default [],it return error: ERROR: syntax error at or near "[" LINE 2:

Re: [ADMIN] how to do prefix_range default value?

2009-04-08 Thread Tony Liao
Dimitri,thank you.it works well. yours,tony 2009/4/6 Dimitri Fontaine > Hi, > > On Friday 03 April 2009 05:03:37 Tony Liao wrote: > > now I want to insert default value [] to prefix column,because if &

[ADMIN] how to improve performance in libpq?

2009-05-13 Thread Tony Liao
Hi,All, I have a question in libpq.the postgresql dadabase about 32MB(base on backup),and I tried to analyze query as :EXPLAIN ANALYZE SELECT .where id=123 ,got the total actual time is 2.882ms. Now,I start a test programe base on ../src/test/examples/testlibpq.c ,which has 900 co

Re: [ADMIN] how to improve performance in libpq?

2009-05-13 Thread Tony Liao
ions and use > a pooling service instead, then run your tests again. > > > > > > > > *De:* pgsql-admin-ow...@postgresql.org [mailto: > pgsql-admin-ow...@postgresql.org] *En nombre de *Tony Liao > *Enviado el:* miércoles, 13 de mayo de 2009 22:39 > *Para:* pgsql

[ADMIN] order by question

2009-06-19 Thread Tony Liao
... any Idea? thanks -- Tony Liao

Re: [ADMIN] order by question

2009-06-19 Thread Tony Liao
pplication,and it is not sure how many product_id in condition,maybe the next query would be .product_id in (4,26,7,8,9,23,27,54) Maybe,temp table is a solution,but that would be performance issue. thanks 2009/6/19 Scott Marlowe > On Fri, Jun 19, 2009 at 3:50 AM, Tony