Re: [GENERAL] Performance issue with libpq prepared queries on 9.3 and 9.4

2014-11-13 Thread Sam Saffron
Thank you so much! So to recap the general way to reproduce this issue is: create table products(id int primary key, type varchar); insert into products select generate_series(1,1), 'aaa'; insert into products select generate_series(10001,2), 'bbb'; create index idx on products(type); pre

Re: [HACKERS] Re: [GENERAL] Performance issue with libpq prepared queries on 9.3 and 9.4

2014-11-13 Thread Tom Lane
David Johnston writes: > ​While "planner hints" comes to mind...on the SQL side can we extend the > "PREPARE" command with two additional keywords?​ > ​PREPARE > name [ ( data_type [, ...] ) ] [ > [NO] GENERIC > ​] ​ > ​AS statement Don't really see the point. The OP's problem is t

Re: [HACKERS] Re: [GENERAL] Performance issue with libpq prepared queries on 9.3 and 9.4

2014-11-13 Thread David Johnston
On Thu, Nov 13, 2014 at 5:47 PM, Tom Lane wrote: > David G Johnston writes: > > Tom Lane-2 wrote > >> In the meantime, I assume that your real data contains a small > percentage > >> of values other than these two? If so, maybe cranking up the statistics > >> target would help. If the planner

Re: [GENERAL] Performance issue with libpq prepared queries on 9.3 and 9.4

2014-11-13 Thread Tom Lane
Sam Saffron writes: > I have hit a rather odd issue with prepared queries on both pg 9.3 and 9.4 > beta. > I have this table (copy at http://samsaffron.com/testing.db.gz) with a > very odd performance profile: Interesting case. The issue seems to be that your statistics look like this: select

[GENERAL] Performance issue with libpq prepared queries on 9.3 and 9.4

2014-11-13 Thread Sam Saffron
I have hit a rather odd issue with prepared queries on both pg 9.3 and 9.4 beta. I have this table (copy at http://samsaffron.com/testing.db.gz) with a very odd performance profile: When I run the following prepared query it is running significantly slower than the raw counterpart: ``` select *

Re: [GENERAL] hstore, but with fast range comparisons?

2014-11-13 Thread David G Johnston
Andy Colson wrote > On 11/13/2014 3:46 PM, Guyren Howe wrote: >> I want to do something that is perfectly satisfied by an hstore column. >> *Except* that I want to be able to do fast (ie indexed) <, > etc >> comparisons, not just equality. >> >> From what I can tell, there isn’t really any way to

Re: [GENERAL] hstore, but with fast range comparisons?

2014-11-13 Thread Andy Colson
On 11/13/2014 3:46 PM, Guyren Howe wrote: I want to do something that is perfectly satisfied by an hstore column. *Except* that I want to be able to do fast (ie indexed) <, > etc comparisons, not just equality. From what I can tell, there isn’t really any way to get hstore to do this, so I’l

Re: [GENERAL] Are there any downsides to using postgres' data directory on a dedicated drive/partition / filesystem?

2014-11-13 Thread Jonathan Vanasco
Thanks, everyone! For now this will be provisioning physical drive for a box -- and "everything" will be there for now. So OS on one drive, and DB on another. I've run into programs before (mostly on Mac/Win) that are exceedingly not happy if they're run on a drive other than the OS. Sin

[GENERAL] hstore, but with fast range comparisons?

2014-11-13 Thread Guyren Howe
I want to do something that is perfectly satisfied by an hstore column. *Except* that I want to be able to do fast (ie indexed) <, > etc comparisons, not just equality. >From what I can tell, there isn’t really any way to get hstore to do this, so >I’ll have to go to a key-value table. But I th

Re: [GENERAL] Are there any downsides to using postgres' data directory on a dedicated drive/partition / filesystem?

2014-11-13 Thread Tom Lane
Jonathan Vanasco writes: > I'm running postgres on a virtual server > I was wondering if there were any known issues with moving the data directory > to another mounted partition / filesystem. You can put the database directory anywhere you want. Obviously, it has to be trustworthy storage, a

Re: [GENERAL] Re: Are there any downsides to using postgres' data directory on a dedicated drive/partition / filesystem?

2014-11-13 Thread John R Pierce
On 11/13/2014 1:08 PM, David G Johnston wrote: Also, it is recommended to separate system logs, WAL, and data onto separate drives where possible. Are you wanting to just move data or all of these things? I find putting all the disks in one big happy raid10 and leaving everything on the same

[GENERAL] Re: Are there any downsides to using postgres' data directory on a dedicated drive/partition / filesystem?

2014-11-13 Thread David G Johnston
Jonathan Vanasco-7 wrote > I'm running postgres on a virtual server > > I was wondering if there were any known issues with moving the data > directory to another mounted partition / filesystem. Define "moving" Also, it is recommended to separate system logs, WAL, and data onto separate drives

Re: [GENERAL] Are there any downsides to using postgres' data directory on a dedicated drive/partition / filesystem?

2014-11-13 Thread John R Pierce
On 11/13/2014 11:44 AM, Jonathan Vanasco wrote: I'm running postgres on a virtual server I was wondering if there were any known issues with moving the data directory to another mounted partition / filesystem. I do that all the time.I avoid using nfs/smb type shares for data directories,

Re: [GENERAL] Are there any downsides to using postgres' data directory on a dedicated drive/partition / filesystem?

2014-11-13 Thread Bill Moran
On Thu, 13 Nov 2014 14:44:22 -0500 Jonathan Vanasco wrote: > I'm running postgres on a virtual server > > I was wondering if there were any known issues with moving the data directory > to another mounted partition / filesystem. At my previous job the company standard was that databases went

[GENERAL] Are there any downsides to using postgres' data directory on a dedicated drive/partition / filesystem?

2014-11-13 Thread Jonathan Vanasco
I'm running postgres on a virtual server I was wondering if there were any known issues with moving the data directory to another mounted partition / filesystem. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql

Re: [GENERAL] troubleshooting a database that keeps locking up

2014-11-13 Thread Tom Lane
Jonathan Vanasco writes: > I have a database that has started to constantly hang after a brief period of > activity > looking at `select * from pg_stat_activity;` I roughly see the following each > time: > process 1 | > process 2 | in transaction > process 3 | in transacti

[GENERAL] troubleshooting a database that keeps locking up

2014-11-13 Thread Jonathan Vanasco
I have a database that has started to constantly hang after a brief period of activity looking at `select * from pg_stat_activity;` I roughly see the following each time: process 1 | process 2 | in transaction process 3 | in transaction process 4 | p

Re: [GENERAL] Modeling Friendship Relationships

2014-11-13 Thread Jonathan Vanasco
On Nov 11, 2014, at 5:38 PM, Robert DiFalco wrote: > Thoughts? Do I just choose one or is there a clear winner? TIA! I prefer this model user_id__a INT NOT NULL REFERENCES user(id), user_id__b INT NOT NULL REFERENCES user(id), is_reciprocal BOOLEAN primary key (

Re: [GENERAL] sepgsql where are the security labels

2014-11-13 Thread Adrian Klaver
On 11/13/2014 07:37 AM, Ted Toth wrote: Exactly what I talking about ... but unfortunately that appears to have been based on KaiGai's branch and is not in 9.3. The current discuss/work is around row-level-security with patches to 9.5 which is not much help to me now :( Then my previous post w

Re: [GENERAL] sepgsql where are the security labels

2014-11-13 Thread Ted Toth
Exactly what I talking about ... but unfortunately that appears to have been based on KaiGai's branch and is not in 9.3. The current discuss/work is around row-level-security with patches to 9.5 which is not much help to me now :( On Thu, Nov 13, 2014 at 9:26 AM, Adrian Klaver wrote: > On 11/13/2

Re: [GENERAL] sepgsql where are the security labels

2014-11-13 Thread Adrian Klaver
On 11/13/2014 05:58 AM, Ted Toth wrote: This table maintains information about the context of postgresql objects not the data in tables. To follow up, an expanded explanation of the security_label column: https://wiki.postgresql.org/wiki/SEPostgreSQL_Architecture#The_security_label_system_col

Re: [GENERAL] sepgsql where are the security labels

2014-11-13 Thread Adrian Klaver
On 11/13/2014 05:58 AM, Ted Toth wrote: This table maintains information about the context of postgresql objects not the data in tables. http://www.slideshare.net/kaigai/label-based-mandatory-access-control-on-postgresql Slide 23 On Wed, Nov 12, 2014 at 5:56 PM, Adrian Klaver wrote: On

Re: [GENERAL] After insert trigger not work

2014-11-13 Thread Adrian Klaver
On 11/13/2014 04:27 AM, Brilliantov Kirill Vladimirovich wrote: Hello! I use postgre-9.3.5 on windows7 x64. Trigger should update data in table: CREATE TABLE trassa.ram_free_stat ( id serial NOT NULL, device integer NOT NULL, min_value integer NOT NULL, avg_value integer NOT NULL DEFA

[GENERAL] Data corruption

2014-11-13 Thread Russell Keane
We appear to have had some corruption on a customer's postgres cluster. They are on 9.0.17 32bit Windows Server 2003 - Service pack 2 Intel Xeon 2.66GHZ 4GB Memory Raid is setup but doesn't look good - just now showing status of Degraded!! The RAID doesn't look too well currently has status De

Re: [GENERAL] After insert trigger not work

2014-11-13 Thread Brilliantov Kirill Vladimirovich
Melvin Davidson wrote on 11/13/2014 05:29 PM: s for I suspect your problem is because you have 6 columns that are NOT NULL, but on INSERT you are only supplying values for 4 columns plus the id(serial). Therefore, the INSERT will fail. Perhaps if you supplied a value for last_update you it will w

Re: [GENERAL] sepgsql where are the security labels

2014-11-13 Thread Ted Toth
This table maintains information about the context of postgresql objects not the data in tables. On Wed, Nov 12, 2014 at 5:56 PM, Adrian Klaver wrote: > On 11/12/2014 02:45 PM, Ted Toth wrote: >> >> I'm running selinux mls policy I've got labeled ipsec working and my >> postgresql configured to l

Re: [GENERAL] Two instances of Postgres with single data directory

2014-11-13 Thread Michael Paquier
On Thu, Nov 13, 2014 at 9:17 PM, dineshkaarthick wrote: > All, > > I need to know is it possible to execute two instances of Postgres with > single data directory shared between the two instances. No, a server instance cannot run on a data folder being used by an existing instance. -- Michael -

[GENERAL] After insert trigger not work

2014-11-13 Thread Brilliantov Kirill Vladimirovich
Hello! I use postgre-9.3.5 on windows7 x64. Trigger should update data in table: CREATE TABLE trassa.ram_free_stat ( id serial NOT NULL, device integer NOT NULL, min_value integer NOT NULL, avg_value integer NOT NULL DEFAULT 0, max_value integer NOT NULL, last_update timestamp without

[GENERAL] Two instances of Postgres with single data directory

2014-11-13 Thread dineshkaarthick
All, I need to know is it possible to execute two instances of Postgres with single data directory shared between the two instances. This is to know if we can achieve Oracle RAC like cluster for Postgres. Regards Dina -- View this message in context: http://postgresql.nabble.com/Two-instance