[GENERAL] Adding an "and is not null" on an indexed field slows the query down immensely.

2011-01-14 Thread Tim Uckun
I have this query it runs reasonably quickly. SELECT "consolidated_urls".* FROM "consolidated_urls" INNER JOIN "topical_urls" ON "consolidated_urls".id = "topical_urls".consolidated_url_id WHERE (("topical_urls".domain_id = 157) AND ((topical_urls.hidden = 'f'))) ORDER BY index_delta DESC LIM

Re: [GENERAL] HA solution

2011-01-14 Thread John R Pierce
On 01/14/11 9:47 PM, Jaiswal Dhaval Sudhirkumar wrote: Hi, I am looking for active-active clustering solution. best of luck.active-active is fraught with complex hard-to-solve problems. I have one SAN box and two separate NODES, where I need to create active-active cluster. My data

Re: [GENERAL] HA solution

2011-01-14 Thread Alan Hodgson
On January 14, 2011, "Jaiswal Dhaval Sudhirkumar" wrote: > Hi, > > I am looking for active-active clustering solution. > > I have one SAN box and two separate NODES, where I need to create > active-active cluster. My data directory would be one and mounted to the > SAN box for both the nodes. (

[GENERAL] HA solution

2011-01-14 Thread Jaiswal Dhaval Sudhirkumar
Hi, I am looking for active-active clustering solution. I have one SAN box and two separate NODES, where I need to create active-active cluster. My data directory would be one and mounted to the SAN box for both the nodes. (There will be one sharable data directory for both the nodes) So the

Re: [GENERAL] Time Series on Postgres (HOWTO?)

2011-01-14 Thread Jasen Betts
On 2011-01-15, bubba postgres wrote: > --000e0cd332267ac2e60499d7ceb2 > Content-Type: text/plain; charset=ISO-8859-1 > > I've been googling, but haven't found a good answer to what I should do if I > want to store time series in Postgres. > It would be nice if I could use 1 sample per column,(bec

[GENERAL] plpythonu memory leak

2011-01-14 Thread Daniel Popowich
I am working with very large sets of time-series data. Imagine a table with a timestamp as the primary key. One question I need to ask of my data is: Are there gaps of time greater than some interval between consecutive rows? I wrote a function in plpgsql to answer this question and it worked g

Re: [GENERAL] Time Series on Postgres (HOWTO?)

2011-01-14 Thread Whit Armstrong
I think you want to look at kdb, onetick, and LIM (those are commercial). or potentially mongoDB where you could probably store a compressed ts directly in the db if you want. If you're not going to store each observation as a row, then why use a db at all. why not stick to flat files? -Whit O

[GENERAL] Time Series on Postgres (HOWTO?)

2011-01-14 Thread bubba postgres
I've been googling, but haven't found a good answer to what I should do if I want to store time series in Postgres. My current solution is store serialized (compressed) blobs of data. (So for example store 1 day worth of 1 minute samples (~1440 samples) stored as one row in a bytea. (Plus meta data

[GENERAL] Re: [pgsql-es-ayuda] Oferta de un nuevo Entrenamiento en el marco del Tercer PGDay Latinoamericano.

2011-01-14 Thread Gunnar Wolf
Ing. Yunior Mesa Reyes dijo [Fri, Jan 14, 2011 at 10:36:42AM -0500]: > Favor hacerle llegar a todos los contactos posibles. > Estimados, > nos complace informarles que se confirmó la realización de otro entrenamiento > en el marco del Tercer PGDay Latinoamericano a celebrarse del 1 al 5 de > fe

Re: [GENERAL] pg_db_role_setting info not dumped

2011-01-14 Thread Adrian Klaver
On Friday 14 January 2011 2:52:18 pm Tom Lane wrote: > Adrian Klaver writes: > > Postgres 9.0.2 > > I used the ALTER DATABASE command to create a database specific SET > > configuration. The problem is that information does not seem to be > > dumped. I have tried pg_dumpall -g, pg_dumpall as well

Re: [GENERAL] migrate hashname function from 8.1.x to 8.4

2011-01-14 Thread Jasen Betts
On 2011-01-11, =?utf-8?Q?Nicol=C3=A1s_Garfinkiel?= wrote: > Violence aside, thanks for your answer. The C module is what I was > planning to do, but was not sure if there is another way. Of course > using crypt would be the right thing to do, but I cannot afford it, as > users from our system c

Re: [GENERAL] array_agg-like thing over arrays

2011-01-14 Thread Andrew Sullivan
On Sat, Jan 15, 2011 at 01:35:20AM +0300, Dmitriy Igrishin wrote: > Try SELECT item_id, array_agg(arrayofstuff::text) from eg1 WHERE class_id = > 1; Doh! That's it. Thanks! A -- Andrew Sullivan a...@crankycanuck.ca -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To mak

Re: [GENERAL] pg_db_role_setting info not dumped

2011-01-14 Thread Tom Lane
Adrian Klaver writes: > Postgres 9.0.2 > I used the ALTER DATABASE command to create a database specific SET > configuration. The problem is that information does not seem to be dumped. I > have tried pg_dumpall -g, pg_dumpall as well as a pg_dump for the individual > database. Am I missing som

Re: [GENERAL] array_agg-like thing over arrays

2011-01-14 Thread Dmitriy Igrishin
Hey Andrew, 2011/1/15 Andrew Sullivan > Hi all, > > I could swear I remember being able to do this in the past, but it > doesn't seem I can remember how, and I have been unable to find > anything in The Fine Materials. > > I want to produce the output of rows of arrays as an aggregated array: >

[GENERAL] pg_db_role_setting info not dumped

2011-01-14 Thread Adrian Klaver
Postgres 9.0.2 I used the ALTER DATABASE command to create a database specific SET configuration. The problem is that information does not seem to be dumped. I have tried pg_dumpall -g, pg_dumpall as well as a pg_dump for the individual database. Am I missing something? -- Adrian Klaver adrian

[GENERAL] array_agg-like thing over arrays

2011-01-14 Thread Andrew Sullivan
Hi all, I could swear I remember being able to do this in the past, but it doesn't seem I can remember how, and I have been unable to find anything in The Fine Materials. I want to produce the output of rows of arrays as an aggregated array: create table eg1 (class_id int, item_id int8, arrayofs

Re: [GENERAL] Record with a field consisting of table rows

2011-01-14 Thread Alban Hertroys
On 14 Jan 2011, at 16:03, Jon Smark wrote: > Hi, > > This thread has veered off-topic, but my original problem still remains. > Basically, I want to declare a function that returns a tuple consisting > of an integer and a set of table rows. Something like the following: > > CREATE FUNCTION foob

Re: [GENERAL] tsearch (or related) question

2011-01-14 Thread Tom Lane
Satoshi Nagayasu writes: > I want to hit a row when I use 'a&b' or 'b&c' in a tsquery, > but not 'a&c'. Wouldn't this do it? tsvectorcol @@ '(a&b | b&c) & !(a&c)' regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make ch

Re: [GENERAL] Question about concurrent synchronous and asynchronous commits

2011-01-14 Thread Vick Khera
On Thu, Jan 13, 2011 at 6:55 PM, Dan Birken wrote: > When you begin a transaction, all your changes write to the in-memory WAL > buffer, and that buffer flushes to disk when: > a) Somebody commits a synchronous transaction > b) The WAL buffer runs out of space > Please correct me if I'm wrong. I

Re: [GENERAL] Record with a field consisting of table rows

2011-01-14 Thread Pavel Stehule
2011/1/14 Jon Smark : > Hi, > > This thread has veered off-topic, but my original problem still remains. > Basically, I want to declare a function that returns a tuple consisting > of an integer and a set of table rows.  Something like the following: > > CREATE FUNCTION foobar () RETURNS (int4, SET

Re: [GENERAL] Record with a field consisting of table rows

2011-01-14 Thread Jon Smark
Hi, This thread has veered off-topic, but my original problem still remains. Basically, I want to declare a function that returns a tuple consisting of an integer and a set of table rows. Something like the following: CREATE FUNCTION foobar () RETURNS (int4, SETOF users) Now, if I understand co

[GENERAL] tsearch (or related) question

2011-01-14 Thread Satoshi Nagayasu
Hi all, I'm looking for some tricky way for tsearch query. Now, I know when a tsvector column has an array ('a', 'b', 'c'), tsquery ('a&c') hits the row. But I want to search rows with considering the order of tsvector elements. I want to hit a row when I use 'a&b' or 'b&c' in a tsquery, but no

[GENERAL] Re: [ANNOUNCE] Para participantes extranjeros en el Tercer PGDay Latinoamericano.

2011-01-14 Thread Alfonso Ardila Toro
** Nombre completo.ALFONSO ARDILA TORO ** # de pasaporte y/o cédula de indetidad.16.738.923 CEDULA DE CIUDADANIA ** Nacionalidad y país de residencia. COLOMBIA ** Fecha de entrada y salida del país.UN DIA ANTES Y UN DIA DESPUES ALFONSO ARDILA TORO Date: M

[GENERAL] Re: [pgsql-es-ayuda] Oferta de Entrenamientos en el marco del Cuarto PGDay Latinoamericano.

2011-01-14 Thread Luis Fernando Lopez Aguilar
Podran grabar videos (screencasts) de todas las actividades del pgday? para asi se tenga mas difusion y poder bajar los videos. Saludos Fernando Lopez Bolivia El 11 de enero de 2011 16:30, Ing. Yunior Mesa Reyes escribió: > Para divulgar por todas las vías posibles... > > Durante el Cuarto PGDay

Re: [GENERAL] quote_literal

2011-01-14 Thread Pavel Stehule
Hello this is correct SELECT col1 FROM table WHERE col2=var INTO res; Regards Pavel Stehule 2011/1/14 tbazadaykin : > CREATE OR REPLACE FUNCTION "scheme"."function" (var varchar) RETURNS varchar > AS > DECLARE >  res varchar; > BEGIN >  /* Which is correct? This: */ > >  /*Or this:*/ >  SELECT

[GENERAL] quote_literal

2011-01-14 Thread tbazadaykin
CREATE OR REPLACE FUNCTION "scheme"."function" (var varchar) RETURNS varchar AS DECLARE res varchar; BEGIN /* Which is correct? This: */ SELECT col1 FROM table WHERE col2=var INTO res; /*Or this:*/ SELECT col1 FROM table WHERE col2=quote_literal(var) INTO res; RETURN res; END; -- S

Re: [GENERAL] Performance on multiple OR conditions inside ()

2011-01-14 Thread Håvard Wahl Kongsgård
This alternative was a little faster and does not return duplicated rows. It will take 41 hours on my system, but it will have to do for now. SELECT vciia_main.sitrp,vciia_main.date_time,ST_AsText(vciia_main.geom) from vciia_main, south_vietnam72 where st_within(vciia_main.geom, south_vietnam72.ge