Re: [SQL] "reverse()" on strings

2002-08-28 Thread h012
the inputs first, to maximize cache hit/miss ratio, such as "CREATE INDEX extension_idx ON file (reverse(name)) ORDER BY name" ? On Mon, 26 Aug 2002, Josh Berkus wrote: > Jeff, h012, > > > CREATE FUNCTION fn_strrev(text) returns text as ' > > return revers

[SQL] "reverse()" on strings

2002-08-26 Thread h012
Hi, CREATE TABLE file (name varchar(255)); I have a couple of milion filenames. I need to build index based on extensions. A couple of possibilities come to mind: CREATE INDEX extension_idx ON file (reverse(name)); -- but I didn't find a function called "reverse" CREATE INDEX extension_

Re: [SQL] slowing down too fast - why ?

2002-08-11 Thread h012
I've even launched the backend with "-F" and removed BEGIN/COMMIT and LOCK TABLE and FOR UPDATE, but I still get slow response. only when count(*) from file is 16000, I get about 2-3 rows / second on average. When count(*) from file was 100, I get about 20-30 rows / second. Help ! T

Re: [SQL] slowing down too fast - why ?

2002-08-10 Thread h012
and I forgot to mention that my stats are available at: http://John.Vicherek.com/slow/times.query.txt John On Sun, 11 Aug 2002 [EMAIL PROTECTED] wrote: > > > Hi, > > I must be doing something silly. I have a 900MHz, 384MB RAM, and > this thing is slow. (Postgresql-7.1.2). > > And

[SQL] slowing down too fast - why ?

2002-08-10 Thread h012
Hi, I must be doing something silly. I have a 900MHz, 384MB RAM, and this thing is slow. (Postgresql-7.1.2). And growing exponencially slower. SQL: http://John.Vicherek.com/slow/schema.sql (save to /tmp/schema.sql) am.dat: http://John.Vicherek.com/slow/am.dat (save to /tmp/am.dat ) pe

[SQL] retrieving all rows from a "tree" in one select - how ?

2002-08-09 Thread h012
Hi, I realize that a relational database may not be ideal for storing (and retrieving) tree-like strucutres, but it looks like you guys are doing with PostgreSQL the impossible anyway. Having table t of all nodes: CREATE SEQUENCE nodeIDseq START 1; CREATE TABLE t( id int PRIMARY

Re: [SQL] expressions operating on arrays

2002-08-09 Thread h012
Great ! I'll try patching it. Thanks Oleg & Teodor for doing all this great work ! Long live PostgreSQL ! see yea, John On Fri, 9 Aug 2002, Oleg Bartunov wrote: > Hmm, > > you dont' need to use GiST supporting functions ! > We've posted a patch to current CVS, it has everyt

Re: [SQL] expressions operating on arrays

2002-08-08 Thread h012
thanks for the pointer, I'm now able to use the operators in expressions! w.r.t. modifying the array contents: I looked through /usr/lib/pgsql/contrib/intarray/_int.sql.in , but it didn't make me any smarter. Are the "..._union" and "..._picksplit" functions supposed to add into and remove

[SQL] expressions operating on arrays

2002-08-08 Thread h012
Hi, I would like to say: create table test1 (array1 int4[]); insert into test1 values ('{123,234,345}'); insert into test1 values ('{456,567,678}'); now what I don't know how to do: -- consider contents of array: select * from test1 where array1 CONTAINS 567; -- APPEND '789' to array in