[GENERAL] Is my understanding of bitmap index scans and recheck cond correct?

2014-12-20 Thread AlexK987
I think that when the query planner chooses to use an index to satisfy a range scan, it verifies how the order of index keys is correlated with physical order of rows in the table. If correlation is low, than the planner wants to make sure that it reads each page only once. So, first PG scans the

Re: [GENERAL] Is clustering factor stored in pg_stats.correlation?

2014-12-20 Thread AlexK987
Thank you Tom, that's exactly what I meant. I believe the term "clustering factor" is well-known: http://use-the-index-luke.com/glossary/index-clustering-factor What is the right word to use instead in Postgres universe? -- View this message in context: http://postgresql.nabble.com/Is-cluste

Re: [GENERAL] Is clustering factor stored in pg_stats.correlation?

2014-12-20 Thread Tom Lane
AlexK987 writes: > I believe that tables' clustering factors are stored in pg_stats.correlation. Dunno what you mean by "clustering factor", but pg_stats.correlation stores the correlation coefficient between the sequence of the column's data values and the sequence of their physical order. Corr

[GENERAL] Is clustering factor stored in pg_stats.correlation?

2014-12-20 Thread AlexK987
I believe that tables' clustering factors are stored in pg_stats.correlation. Here is how I came to this conclusion: create table narrow_table as with numbers as( select generate_series as n from generate_series(0,1048575)) select n as seq_number, (n/1024) + ((n%1024)<<10) as rand_number from nu

Re: [GENERAL] How to connect to postgres.app on Mac from PgAdmin

2014-12-20 Thread AlexK987
This worked, thank you! -- View this message in context: http://postgresql.nabble.com/How-to-connect-to-postgres-app-on-Mac-from-PgAdmin-tp5831604p5831609.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list (pgsql-general@postgre

Re: [GENERAL] How to connect to postgres.app on Mac from PgAdmin

2014-12-20 Thread Adrian Klaver
On 12/20/2014 12:46 PM, AlexK987 wrote: I've installed postgres.app on my Mac. It did not prompt me for any password. I am trying to connect to it via PgAdmin, from the same Mac laptop, providing localhost as hostname, postgres as username, and no password. I am getting "FATAL: role postgres doe

[GENERAL] How to connect to postgres.app on Mac from PgAdmin

2014-12-20 Thread AlexK987
I've installed postgres.app on my Mac. It did not prompt me for any password. I am trying to connect to it via PgAdmin, from the same Mac laptop, providing localhost as hostname, postgres as username, and no password. I am getting "FATAL: role postgres does not exist". Which credentials should

Re: [GENERAL] Monitoring query plan cache

2014-12-20 Thread Tom Lane
Andomar writes: > We run a Postgres 9.1 system that handles a lot of identical queries > (around 500 per second.) The queries originate from a Python WSGI script > running under Apache. > Performance is an issue, and we suspect query planning might be an > underlying cause. I've rewritten the

[GENERAL] pg_audit_users - Auditing user activity

2014-12-20 Thread Pierre
Hi I'm working on a web credit card payment solution, so in a PCI-DSS environment, and the auditors gave me trouble with one specific audit point for the PostgreSQL database. They require the list of users in the database that had no activity in the past 90 days to be deleted. So far, it seems the

Re: [GENERAL] pg_audit_users - Auditing user activity

2014-12-20 Thread Adrian Klaver
On 12/20/2014 07:22 AM, Pierre Ducroquet wrote: On Saturday, December 20, 2014 06:57:54 AM Adrian Klaver wrote: On 12/20/2014 06:40 AM, Pierre Ducroquet wrote: Hi I'm working on a web credit card payment solution, so in a PCI-DSS environment, and the auditors gave me trouble with one specific

Re: [GENERAL] pg_audit_users - Auditing user activity

2014-12-20 Thread Pierre Ducroquet
On Saturday, December 20, 2014 06:57:54 AM Adrian Klaver wrote: > On 12/20/2014 06:40 AM, Pierre Ducroquet wrote: > > Hi > > > > I'm working on a web credit card payment solution, so in a PCI-DSS > > environment, and the auditors gave me trouble with one specific audit point > > for the PostgreSQL

Re: [GENERAL] pg_audit_users - Auditing user activity

2014-12-20 Thread Adrian Klaver
On 12/20/2014 06:40 AM, Pierre Ducroquet wrote: Hi I'm working on a web credit card payment solution, so in a PCI-DSS environment, and the auditors gave me trouble with one specific audit point for the PostgreSQL database. They require the list of users in the database that had no activity in th

[GENERAL] pg_audit_users - Auditing user activity

2014-12-20 Thread Pierre Ducroquet
Hi I'm working on a web credit card payment solution, so in a PCI-DSS environment, and the auditors gave me trouble with one specific audit point for the PostgreSQL database. They require the list of users in the database that had no activity in the past 90 days to be deleted. So far, it seems

[GENERAL] Monitoring query plan cache

2014-12-20 Thread Andomar
Hi, We run a Postgres 9.1 system that handles a lot of identical queries (around 500 per second.) The queries originate from a Python WSGI script running under Apache. Performance is an issue, and we suspect query planning might be an underlying cause. I've rewritten the scripts from ad-hoc

Re: [GENERAL] Blocking access by remote users for a specific time period

2014-12-20 Thread Joseph Kregloh
The way I would do it is to setup pgBouncer and control the user access from there. Not to mention the connection pooling gains you would get from pgBouncer itself. The simples way is to setup all of the users to connect through pgBouncer, then the admin users connect to the Postgresql port directl

Re: [GENERAL] Problem with constraint exclusion on partitions

2014-12-20 Thread David G Johnston
David G Johnston wrote > On Saturday, December 20, 2014, Mike Pultz [via PostgreSQL] < > ml-node+s1045698n5831551h5@.nabble >> wrote: > >> Hey David, >> >> > What version are you using? >> >> Sorry, I'm on 9.3.4. >> >> >Now() is a volatile function so the planner cannot omit partitions. >> > >>