[GENERAL] Postgresql, PSN hack and table limits

2011-04-30 Thread Mark Morgan Lloyd
Somebody is making a very specific claim that Postgres can support a limited number of rows: "INPS (a data forensics team) said that there is 7 main Databases all hosted at different data centers but linked over a type of 'cloud' Each database uses PostGRESSQL which would mean the most amount

Re: [GENERAL] Values larger than 1/3 of a buffer page cannot be indexed (hstore)

2011-04-30 Thread Tom Lane
Stefan Keller writes: > Any ideas on how to index my hstore attribute? Use a GIST or GIN index. The only thing that a btree index on hstore can do for you is to support equality comparisons on the whole hstore value, which is pretty unlikely to be what you're after. rega

Re: [GENERAL] histogram

2011-04-30 Thread Rob Sargent
David Johnston wrote: Given that you are actively implementing the code that uses the 1 and 2 I don't see how it is that egregious. When generating calculated fields it is cleaner than the alternative: Select trunc(distance * 10.)/10., count(*) From doc_ads Group by (trunc(distance * 10.)) Or

[GENERAL] Values larger than 1/3 of a buffer page cannot be indexed (hstore)

2011-04-30 Thread Stefan Keller
Hi, 2011/3/13 Viktor Nagy > when trying to insert a long-long value, I get the following error: > > ERROR: Index row size 3120 exceeds maximum 2712 for index > "ir_translation_ltns" > HINT: Values larger than 1/3 of a buffer page cannot be indexed. > Consider a function index of an MD5 hash of

Re: [GENERAL] histogram

2011-04-30 Thread David Johnston
Given that you are actively implementing the code that uses the 1 and 2 I don't see how it is that egregious. When generating calculated fields it is cleaner than the alternative: Select trunc(distance * 10.)/10., count(*) >From doc_ads Group by (trunc(distance * 10.)) Order by (trunc(distance *

Re: [GENERAL] [HACKERS] PostgreSQL Core Team

2011-04-30 Thread Dimitri Fontaine
Thom Brown writes: > Excellent! Magnus is a very valuable contributor to the PostgreSQL > community and I think the community can only benefit from this addition to > the core team. +1 Congrats, Magnus! -- Dimitri Fontaine http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

Re: [GENERAL] Partitioning an existing table

2011-04-30 Thread Dimitri Fontaine
disclaimer : I didn't read the presentation paper Greg Smith talked about yet, nor his partitioning chapter yet, so it might be about the same trick. Phoenix Kiula writes: > How about doing this with existing massive tables? (Over 120 million rows) > > I could create a new parent table with chil

Re: [GENERAL] converting databases form SQL_ASCII to UTF8

2011-04-30 Thread Dimitri Fontaine
Geoffrey Myers writes: > So, now the question is, is this effort even worth our effort? > What is the harm in leaving our databases SQL_ASCII encoded? You're declaring bankruptcy on being able to make any sense of the data you stored. Is that really what you think you need? For converting, you

Re: [GENERAL] Multiple instances with same version?

2011-04-30 Thread Dimitri Fontaine
durumdara writes: > I want to ask that have some way to install PGSQL 9.0 as two instances in > one machine? > > Most important question. The OS is can be Windows or Linux. debian and ubuntu packaging support this quite well, see pg_lsclusters and associated man pages: http://manpages.debian.n

Re: [GENERAL] Huge spikes in number of connections doing "PARSE"

2011-04-30 Thread hubert depesz lubaczewski
On Sat, Apr 30, 2011 at 08:55:09PM +0200, Dimitri Fontaine wrote: > hubert depesz lubaczewski writes: > > we have n (~ 40 i think) web servers. each webserver has it's own > > pgbouncer (in session pooling). > > In some cases I have found useful to have those webserver's pgbouncer > connect to an

Re: [GENERAL] Huge spikes in number of connections doing "PARSE"

2011-04-30 Thread Dimitri Fontaine
hubert depesz lubaczewski writes: > we have n (~ 40 i think) web servers. each webserver has it's own > pgbouncer (in session pooling). In some cases I have found useful to have those webserver's pgbouncer connect to another pgbouncer on the database host. But if your problem is tied to real act

Re: [GENERAL] GIN index not used

2011-04-30 Thread Mark
Alban thank for your ideas > It probably is, the default Postgres settings are quite modest and GIN > indexes are memory hungry. > I think you need to increase shared_buffers. With 2.5GB of memory (such a > strange number) the docs> suggest about 250MB. > See > http://www.postgresql.org/doc

Re: [GENERAL] histogram

2011-04-30 Thread Rob Sargent
re: 1 and 2. They're horrible (imho) reference to the attributes of the returned tuple. Or at best an exposure of the implementation. :) Order by "2" if you want the most frequent (highest counts) of your distances at the bottom of the output (or ordery by 2 desc) if you want them at the top o

Re: [GENERAL] Short-circuit boolean evaluation

2011-04-30 Thread Tom Lane
David Johnston writes: > No. It will not be called > Or > No. Postgresql does not short-circuit boolean evaluations > ? The correct answer is "maybe". See http://www.postgresql.org/docs/9.0/static/sql-expressions.html#SYNTAX-EXPRESS-EVAL regards, tom lane -- Sent via p

Re: [GENERAL] histogram

2011-04-30 Thread Joel Reymont
I think this should do what I want select trunc(distance * 10.)/10., count(*) from doc_ads group by 1 order by 1 Thanks, Joel -- - for hire: mac osx device driver ninja, kernel extensions and usb d

Re: [GENERAL] histogram

2011-04-30 Thread Joel Reymont
What is the meaning of group by 1 order by 2 e.g. what to the numbers 1 and 2 stand for? What would change if I do the following? group by 1 order by 1 On Apr 30, 2011, at 5:48 PM, Thomas Markus wrote: > Hi, > > try something like this: > > select >trunc(random(

Re: [GENERAL] histogram

2011-04-30 Thread Joel Reymont
Thank you Thomas! Is there a way for the code below to determine the number of rows in the table and use it? Thanks, Joel On Apr 30, 2011, at 5:48 PM, Thomas Markus wrote: > Hi, > > try something like this: > > select >trunc(random() * 10.)/10. >, count(*) > from >generat

Re: [GENERAL] histogram

2011-04-30 Thread Thomas Markus
Hi, try something like this: select trunc(random() * 10.)/10. , count(*) from generate_series(1,200) group by 1 order by 2 regards Thomas Am 30.04.2011 18:37, schrieb Joel Reymont: I have a column of 2 million float values from 0 to 1. I would like to figure out how many valu

[GENERAL] histogram

2011-04-30 Thread Joel Reymont
I have a column of 2 million float values from 0 to 1. I would like to figure out how many values fit into buckets spaced by 0.10, e.g. from 0 to 0.10, from 0.10 to 0.20, etc. What is the best way to do this? Thanks, Joel

Re: [GENERAL] Short-circuit boolean evaluation

2011-04-30 Thread Martijn van Oosterhout
On Sat, Apr 30, 2011 at 10:34:32AM -0400, David Johnston wrote: > No. It will not be called > Or > No. Postgresql does not short-circuit boolean evaluations > ? SQL is a somewhat declarative language. There is no "order" to evaluation as such. So you can't talk about short circuiting either. This

Re: [GENERAL] Short-circuit boolean evaluation

2011-04-30 Thread David Johnston
No. It will not be called Or No. Postgresql does not short-circuit boolean evaluations ? On Apr 30, 2011, at 10:27, pasman pasmański wrote: > No. > > 2011/4/30, Jon Smark : >> Hi, >> >> Does Postgresql perform short-circuit boolean evaluation both in SQL >> and PL/pgSQL functions? As an examp

Re: [GENERAL] Short-circuit boolean evaluation

2011-04-30 Thread pasman pasmański
No. 2011/4/30, Jon Smark : > Hi, > > Does Postgresql perform short-circuit boolean evaluation both in SQL > and PL/pgSQL functions? As an example, suppose I have a function called > "do_stuff" which is computationally intensive. In the example below, > will it be called for rows for which the fi

[GENERAL] Short-circuit boolean evaluation

2011-04-30 Thread Jon Smark
Hi, Does Postgresql perform short-circuit boolean evaluation both in SQL and PL/pgSQL functions? As an example, suppose I have a function called "do_stuff" which is computationally intensive. In the example below, will it be called for rows for which the first predicate (foobar.id = $1) is false

Re: [GENERAL] Switching Database Engines

2011-04-30 Thread Greg Smith
On 04/28/2011 12:19 PM, Carlos Mennens wrote: It seems that the 'mysql2postgres.pl' tool has instructions embedded into the file so I ran the command as instructed to take the output file and insert it into my PostgreSQL server and got the following error message: $ psql -p 5432 -h db1 -U wiki -

Re: [GENERAL] Looking for Silicon Valley/Peninsula/San Francisco users group

2011-04-30 Thread Joshua D. Drake
On 04/29/2011 10:01 PM, Greg Smith wrote: On 04/29/2011 06:13 PM, Jeff Davis wrote: I'm not sure which reference you found, but SFPUG is certainly active with meetings every month. http://pugs.postgresql.org/sfpug ; last meeting listed there is January 2009. Yeah, that site is kind of.