[GENERAL] Joining on a view containing a UNION ALL produces a suboptimal plan on 9.3.4

2014-07-10 Thread Chris Hanks
Hi everyone - I have a slow query issue in an app I'm working on. I'm unfortunately not at liberty to share the query/schema details, but I've put together a very similar reproduction of the issue: - CREATE TABLE a (id integer primary key, col integer); CREATE TABLE b (id integer primary

[GENERAL] Standby Server and Barman Backup on production system

2014-07-10 Thread basti
Hello, I had followed this discuss (http://www.postgresql.org/message-id/CABRT9RAXzUa=_zT_M4Z1vyDuFkpgNCZLUnRTUO5gvK2kKkNu=a...@mail.gmail.com). I have a similar problem now: I use one Postgres Server as Master an an other one as Standby (WAL archives). I do also a daily backup of the Master

Re: [GENERAL] php password authentication failed for user ...

2014-07-10 Thread Francisco Olarte
Hi: On Wed, Jul 9, 2014 at 2:37 PM, basti ba...@unix-solution.de wrote: I don't know whats wrong there hostmydns mydnslocalhost trust works well and #hostall all 0.0.0.0 0.0.0.0 md5 did not work. I use Postgres

Re: [GENERAL] php password authentication failed for user ...

2014-07-10 Thread Ken Tanzer
On Wed, Jul 9, 2014 at 5:37 AM, basti ba...@unix-solution.de wrote: #hostall all 0.0.0.0 0.0.0.0 md5 did not work. If it really starts with a # like you show it above, it's just a comment and pretty much guaranteed not to do anything. Cheers, Ken --

Re: [GENERAL] BAKUP ISSUE

2014-07-10 Thread Marc Watson
De : pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] De la part de hubert depesz lubaczewski Envoyé : July-09-14 9:55 AM On Wed, Jul 9, 2014 at 3:28 PM, Ramesh T rameshparnandit...@gmail.commailto:rameshparnandit...@gmail.com wrote: Yes,not an error it is a

[GENERAL] Should I partition this table?

2014-07-10 Thread AlexK
My table currently uses up 62 GB of storage, and it has 450 M rows. This narrow table has a PK on (ParentID, ChildNumber), and it has between 20K and 50K of child rows per parent. The data is inserted daily, rarely modified, never deleted. The performance of modifications is not an issue. The

Re: [GENERAL] Should I partition this table?

2014-07-10 Thread Bill Moran
On Thu, 10 Jul 2014 07:59:20 -0700 (PDT) AlexK alk...@gmail.com wrote: My table currently uses up 62 GB of storage, and it has 450 M rows. This narrow table has a PK on (ParentID, ChildNumber), and it has between 20K and 50K of child rows per parent. The data is inserted daily, rarely

Re: [GENERAL] Should I partition this table?

2014-07-10 Thread Kevin Grittner
AlexK alk...@gmail.com wrote: My table currently uses up 62 GB of storage, and it has 450 M rows. This narrow table has a PK on (ParentID, ChildNumber), and it has between 20K and 50K of child rows per parent. The data is inserted daily, rarely modified, never deleted. The performance of

Re: [GENERAL] Joining on a view containing a UNION ALL produces a suboptimal plan on 9.3.4

2014-07-10 Thread Igor Neyman
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- ow...@postgresql.org] On Behalf Of Chris Hanks Sent: Thursday, July 10, 2014 5:02 AM To: PostgreSQL General Subject: [GENERAL] Joining on a view containing a UNION ALL produces a suboptimal plan on

Re: [GENERAL] Joining on a view containing a UNION ALL produces a suboptimal plan on 9.3.4

2014-07-10 Thread Chris Hanks
I need it the way it is. It's a foreign key in the actual query. Thanks! On Thu, Jul 10, 2014 at 8:31 AM, Igor Neyman iney...@perceptron.com wrote: -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- ow...@postgresql.org] On Behalf Of Chris Hanks Sent:

Re: [GENERAL] Should I partition this table?

2014-07-10 Thread AlexK
Bill, Regarding SELECT performance improve nearly linerally to the number of partitions, - can you elaborate why? If I split my table into several partitions, even the index depth may stay the same, because the PK is narrow, it only consists of 2 4-byte integers. My selects are distributed more

Re: [GENERAL] Joining on a view containing a UNION ALL produces a suboptimal plan on 9.3.4

2014-07-10 Thread Tom Lane
Chris Hanks christopher.m.ha...@gmail.com writes: CREATE VIEW tables AS SELECT a.*, b.col AS other_col FROM a LEFT JOIN b ON a.id = b.id UNION ALL SELECT c.*, d.col AS other_col FROM c LEFT JOIN d ON c.id = d.id; EXPLAIN ANALYZE SELECT * FROM tables WHERE id = 89; --

Re: [GENERAL] Should I partition this table?

2014-07-10 Thread AlexK
Kevin, For now, all the data fits in the cache: the box has 384GB of RAM. But I want to be ready for later, when we have more data. It is easier to refactor my table now, when it is still smallish. Children are only added to recently added parents, and they are all added/updated/deleted at once.

Re: [GENERAL] Standby Server and Barman Backup on production system

2014-07-10 Thread Quinlan Pfiffer
On Thu, Jul 10, 2014 at 2:24 AM, basti mailingl...@unix-solution.de wrote: Hello, I had followed this discuss (http://www.postgresql.org/message-id/CABRT9RAXzUa=_zT_M4Z1vyDuFkpgNCZLUnRTUO5gvK2kKkNu=a...@mail.gmail.com). I have a similar problem now: I use one Postgres Server as Master an

Re: [GENERAL] Should I partition this table?

2014-07-10 Thread Bill Moran
On Thu, 10 Jul 2014 08:40:59 -0700 (PDT) AlexK alk...@gmail.com wrote: Bill, Regarding SELECT performance improve nearly linerally to the number of partitions, - can you elaborate why? If I split my table into several partitions, even the index depth may stay the same, because the PK is

Re: [GENERAL] Joining on a view containing a UNION ALL produces a suboptimal plan on 9.3.4

2014-07-10 Thread Chris Hanks
That did the trick! Thanks, Tom! On Thu, Jul 10, 2014 at 8:47 AM, Tom Lane t...@sss.pgh.pa.us wrote: Chris Hanks christopher.m.ha...@gmail.com writes: CREATE VIEW tables AS SELECT a.*, b.col AS other_col FROM a LEFT JOIN b ON a.id = b.id UNION ALL SELECT c.*, d.col AS other_col

Re: [GENERAL] Should I partition this table?

2014-07-10 Thread Kevin Grittner
AlexK alk...@gmail.com wrote: For now, all the data fits in the cache: the box has 384GB of RAM. But I want to be ready for later, when we have more data. It is easier to refactor my table now, when it is still smallish. Makes sense. Children are only added to recently added parents, and

Re: [GENERAL] Should I partition this table?

2014-07-10 Thread AlexK
Kevin, What would be the advantages of partitioning on ranges of ParentID? Each query will touch at most one partition. I might or might not get PK indexes one level of depth less. I understand that I will CLUSTER these smaller tables and benefit from that. Other than clustering, what are other

[GENERAL] checkpoint

2014-07-10 Thread Yves Dorfsman
Hi, If I run checkpoint from psql, is it applied to all the databases? What if I do it though an API? When connecting with psycopg2, I'm forced to specify a database name, if I use dbname=postgres, and execute checkpoint;, is it applied to all the databases? Thanks. -- Yves. -- Sent via

Re: [GENERAL] Should I partition this table?

2014-07-10 Thread Bill Moran
On Thu, 10 Jul 2014 11:36:27 -0700 (PDT) AlexK alk...@gmail.com wrote: What would be the advantages of partitioning on ranges of ParentID? Each query will touch at most one partition. I might or might not get PK indexes one level of depth less. You need to partition by ParentID in order for

Re: [GENERAL] checkpoint

2014-07-10 Thread Guillaume Lelarge
2014-07-10 20:56 GMT+02:00 Yves Dorfsman y...@zioup.com: Hi, If I run checkpoint from psql, is it applied to all the databases? What if I do it though an API? When connecting with psycopg2, I'm forced to specify a database name, if I use dbname=postgres, and execute checkpoint;, is it

Re: [GENERAL] checkpoint

2014-07-10 Thread Yves Dorfsman
On 2014-07-10 13:02, Guillaume Lelarge wrote: 2014-07-10 20:56 GMT+02:00 Yves Dorfsman y...@zioup.com mailto:y...@zioup.com: Hi, If I run checkpoint from psql, is it applied to all the databases? What if I do it though an API? When connecting with psycopg2, I'm forced

Re: [GENERAL] Should I partition this table?

2014-07-10 Thread Jeff Janes
On Thu, Jul 10, 2014 at 8:20 AM, Bill Moran wmo...@potentialtech.com wrote: On Thu, 10 Jul 2014 07:59:20 -0700 (PDT) AlexK alk...@gmail.com wrote: My table currently uses up 62 GB of storage, and it has 450 M rows. This narrow table has a PK on (ParentID, ChildNumber), and it has between

Re: [GENERAL] Should I partition this table?

2014-07-10 Thread Jeff Janes
On Thu, Jul 10, 2014 at 11:36 AM, AlexK alk...@gmail.com wrote: Kevin, What would be the advantages of partitioning on ranges of ParentID? Each query will touch at most one partition. I might or might not get PK indexes one level of depth less. I understand that I will CLUSTER these

[GENERAL] invalid connection type listen_addresses='*'

2014-07-10 Thread Aram Fingal
I just tried to set up a PostgreSQL server on an existing instillation of Ubuntu 13.10 server but I am getting an error trying to start the server and I am not finding anything relevant to the error searching the web. Here’s what I did to install: $ sudo apt-get install postgresql $ sudo

Re: [GENERAL] Should I partition this table?

2014-07-10 Thread Bill Moran
On Thu, 10 Jul 2014 13:16:05 -0700 Jeff Janes jeff.ja...@gmail.com wrote: In general, yes, given the information you provided. A parition on ParentID % $something should improve performance. PostgresSQL's constraint exclusion logic is not smart enough to turn a simple equality into a

Re: [GENERAL] invalid connection type listen_addresses='*'

2014-07-10 Thread Paul Jungwirth
listen_addresses='*' I'm pretty sure that listen_addresses belongs in postgresql.conf, not pg_hba.conf. Paul On Thu, Jul 10, 2014 at 1:40 PM, Aram Fingal fin...@multifactorial.com wrote: I just tried to set up a PostgreSQL server on an existing instillation of Ubuntu 13.10 server but I

Re: [GENERAL] invalid connection type listen_addresses='*'

2014-07-10 Thread Igor Neyman
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Aram Fingal Sent: Thursday, July 10, 2014 4:40 PM To: Postgres-General General Subject: [GENERAL] invalid connection type listen_addresses='*' I just tried to set up a PostgreSQL server on an

Re: [GENERAL] invalid connection type listen_addresses='*'

2014-07-10 Thread Aram Fingal
listen_addresses='*' parameter doesn't belong in pg_hba.conf This parameter should be in postgresql.conf Thanks. That was really unclear, at least the way I followed the online documentation: http://www.postgresql.org/docs/9.1/static/auth-pg-hba-conf.html …even after following the

Re: [GENERAL] invalid connection type listen_addresses='*'

2014-07-10 Thread David G Johnston
Aram Fingal wrote listen_addresses='*' parameter doesn't belong in pg_hba.conf This parameter should be in postgresql.conf Thanks. That was really unclear, at least the way I followed the online documentation: http://www.postgresql.org/docs/9.1/static/auth-pg-hba-conf.html

Re: [GENERAL] invalid connection type listen_addresses='*'

2014-07-10 Thread David G Johnston
David G Johnston wrote Aram Fingal wrote listen_addresses='*' parameter doesn't belong in pg_hba.conf This parameter should be in postgresql.conf Thanks. That was really unclear, at least the way I followed the online documentation:

Re: [GENERAL] invalid connection type listen_addresses='*'

2014-07-10 Thread Paul Jungwirth
It is non-specific since it is assumed at this point in the documentation that you realize ALL configuration parameters are defined in postgres.conf or its includes. I think the comments in pg_hba.conf are a lot more misleading than the online documentation, and are more likely to be read.

[GENERAL] Standby Server and Barman Backup on production system

2014-07-10 Thread Sebastian Fiedler - Nexst4 GmbH
Hello, I had followed this discuss (http://www.postgresql.org/message-id/CABRT9RAXzUa=_zT_M4Z1vyDuFkpgNCZLUnRTUO5gvK2kKkNu=a...@mail.gmail.com). I have a similar problem now: I use one Postgres Server as Master an an other one as Standby (WAL archives). I do also a daily backup of the Master

[GENERAL] Windows Installation User account - Correct database for us

2014-07-10 Thread Don Brown
Hello We are writing a small application and we are trying to determine if PostgreSQL is the right database for us. The application at this stage is only for a single user and commonly for persons with little computer expertise. When the database is installed a postgreSQL user account is

[GENERAL] how does full text searching tokenize words ? can it be altered?

2014-07-10 Thread Jonathan Vanasco
I'm getting a handful of 'can not index words longer than 2047 characters' on my `gin` indexes. 1. does this 2047 character count correspond to tokens / indexed words? 2. if so, is there a way to lower this number ? 3. is there a way to profile the index for the frequency of tokens ? (

Re: [GENERAL] Windows Installation User account - Correct database for us

2014-07-10 Thread Steve Atkins
On Jul 10, 2014, at 5:01 PM, Don Brown dbr...@msd.net.au wrote: Hello We are writing a small application and we are trying to determine if PostgreSQL is the right database for us. The application at this stage is only for a single user and commonly for persons with little computer

Re: [GENERAL] Windows Installation User account - Correct database for us

2014-07-10 Thread John R Pierce
On 7/10/2014 5:01 PM, Don Brown wrote: When the database is installed a postgreSQL user account is created which in most cases will be the second user account on the PC. The result of this is the user now has to select the user account when ever the computer is restarted. I thought I saw

[GENERAL] Use of tsvector in array

2014-07-10 Thread Huang, Suya
Hi, We have the requirement of using the data type tsvector [], however, I didn't find out how to: * Use array operator together with tsquery operator o I have to unnest the array and then do query like ts@@ to_tsquery('ipod') * Create GIN index on tsvector[] o ERROR:

Re: [GENERAL] Windows Installation User account - Correct database for us

2014-07-10 Thread David G Johnston
Don Brown wrote Thank you and appreciate any comments/suggestions Host the database in a shared-tenent arrangement and have your application remotely connect to it or to an intermediary application that will then perform the work and simply deal with input/output with the client. Dave --

Re: [GENERAL] Use of tsvector in array

2014-07-10 Thread David G Johnston
Huang, Suya wrote Hi, We have the requirement of using the data type tsvector [], however, I didn't find out how to: * Use array operator together with tsquery operator o I have to unnest the array and then do query like ts@@ to_tsquery('ipod') You will have to create some