Re: [PERFORM] copy vs. C function

2011-12-14 Thread Jon Nelson
On Wed, Dec 14, 2011 at 9:51 AM, Jon Nelson wrote: > On Wed, Dec 14, 2011 at 9:40 AM, Jon Nelson wrote: >> On Wed, Dec 14, 2011 at 9:25 AM, Tom Lane wrote: >>> Jon Nelson writes: Regarding caching, I tried caching it across calls by making the TupleDesc static and only initializing it

Re: [PERFORM] Is it possible to use index on column for regexp match operator '~'?

2011-12-14 Thread Rural Hunter
actually I stored the pattern in col1. I want to get the row whose col1 pattern matches one string 'aaa'. 于2011年12月15日 4:43:37,Marti Raudsepp写到: 2011/12/14 Rural Hunter: for example, the where condition is: where '' ~ col1. I created a normal index on col1 but seems it is not used. I ass

Re: [PERFORM] Is it possible to use index on column for regexp match operator '~'?

2011-12-14 Thread Marti Raudsepp
2011/12/14 Rural Hunter : > for example, the where condition is: where '' ~ col1. I created a normal > index on col1 but seems it is not used. I assume you want to search values that match one particular pattern, that would be col1 ~ '' The answer is, only very simple patterns that start

Re: [PERFORM] Slow query after upgrade from 8.2 to 8.4

2011-12-14 Thread Kaloyan Iliev Iliev
Hi, Thanks for Replay. Actually I finally find a solution. If I rewrite the query in this way: explain analyze select 1 from acc_clients AC, acc_debts AD, debts_desc DD,

Re: [PERFORM] Partitions and joins lead to index lookups on all partitions

2011-12-14 Thread voodooless
Back again, I did some tests with our test machine, having a difficult query doing some fancy stuff ;) I made two versions, one using partitioned data, one, using unpartitioned data, both having the same equivalent indexes. It's using two of those big tables, one 28GB data and 17GB index, one 25G

[PERFORM] Is it possible to use index on column for regexp match operator '~'?

2011-12-14 Thread Rural Hunter
for example, the where condition is: where '' ~ col1. I created a normal index on col1 but seems it is not used. -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] copy vs. C function

2011-12-14 Thread Jon Nelson
On Wed, Dec 14, 2011 at 9:40 AM, Jon Nelson wrote: > On Wed, Dec 14, 2011 at 9:25 AM, Tom Lane wrote: >> Jon Nelson writes: >>> Regarding caching, I tried caching it across calls by making the >>> TupleDesc static and only initializing it once. >>> When I tried that, I got: >> >>> ERROR:  number

Re: [PERFORM] copy vs. C function

2011-12-14 Thread Jon Nelson
On Wed, Dec 14, 2011 at 9:25 AM, Tom Lane wrote: > Jon Nelson writes: >> Regarding caching, I tried caching it across calls by making the >> TupleDesc static and only initializing it once. >> When I tried that, I got: > >> ERROR:  number of columns (6769856) exceeds limit (1664) > >> I tried to f

Re: [PERFORM] copy vs. C function

2011-12-14 Thread Tom Lane
Jon Nelson writes: > Regarding caching, I tried caching it across calls by making the > TupleDesc static and only initializing it once. > When I tried that, I got: > ERROR: number of columns (6769856) exceeds limit (1664) > I tried to find some documentation or examples that cache the > informa

Re: [PERFORM] copy vs. C function

2011-12-14 Thread idc danny
Ah, that did the trick, thank you Kevin, Danny From: Kevin Martyn To: idc danny Cc: "pgsql-performance@postgresql.org" Sent: Wednesday, December 14, 2011 3:14 PM Subject: Re: [PERFORM] copy vs. C function try host all all 5.0.0.0/8  md5 On Wed, Dec 14,

Re: [PERFORM] copy vs. C function

2011-12-14 Thread Jon Nelson
On Wed, Dec 14, 2011 at 12:18 AM, Tom Lane wrote: > Jon Nelson writes: >> The only thing I have left are these statements: > >> get_call_result_type >> TupleDescGetAttInMetadata >> BuildTupleFromCStrings >> HeapTupleGetDatum >> and finally PG_RETURN_DATUM > >> It turns out that: >> get_call_resul

Re: [PERFORM] copy vs. C function

2011-12-14 Thread Kevin Martyn
try host all all 5.0.0.0/8 md5 On Wed, Dec 14, 2011 at 2:02 AM, idc danny wrote: > Hi guys, > A nub question here since I could not figure it out on my own: > I'm using Hamachi to connect different sites into a VPN and their address > always starts with 5.*.*.* - the problem I'm facing is that

Re: [PERFORM] Postgres array parser

2011-12-14 Thread Marc Mamin
> Yes, it would be great, but I haven't found such a function, which > splits 2 dimensional array into rows =) Maybe we'll modify existing > function, but unfortunately we have tried hstore type and function in > postgres and we see a significant performance improvements. So we only > need to conve

Re: [PERFORM] Postgres array parser

2011-12-14 Thread Aleksej Trofimov
Yes, it would be great, but I haven't found such a function, which splits 2 dimensional array into rows =) Maybe we'll modify existing function, but unfortunately we have tried hstore type and function in postgres and we see a significant performance improvements. So we only need to convert exi

Re: [PERFORM] Postgres array parser

2011-12-14 Thread Marc Mamin
Hello, For such cases (see below), it would be nice to have an unnest function that only affect the first array dimension. Something like unnest(ARRAY[[1,2],[2,3]], SLICE=1) => unnest -- [1,2] [2,3] With this function, I imagine that following sql function might beat the plpgsql FOREACH