Re: [GENERAL] Improving performance of merging data between tables

2015-01-07 Thread Pawel Veselov
On Tue, Dec 30, 2014 at 7:25 PM, Maxim Boguk maxim.bo...@gmail.com wrote: On Wed, Dec 31, 2014 at 11:10 AM, Pawel Veselov pawel.vese...@gmail.com wrote [skipped] 2) try pg_stat_statements, setting pg_stat_statements.track = all. see:

[GENERAL] Central management for regular tasks on multiple databases

2015-01-07 Thread Jiří Hlinka
Hi list, I'd like to ask you if you have any experience with some solution or how do you manage tasks described below. We have tens of separate databases (for different apps and purpose) which we want send regular tasks to. The tasks are always SQL queries, for example count some bilance after

Re: [GENERAL] ALTER TABLE to ADD BDR global sequence

2015-01-07 Thread Craig Ringer
On 01/04/2015 12:33 AM, John Casey wrote: While attempting to alter a table to add a global sequence as a primary key using the following commands: CREATE SEQUENCE my_table_id_seq USING bdr; ALTER TABLE my_table ADD COLUMN id integer PRIMARY KEY NOT NULL DEFAULT

Re: [GENERAL] Advice for using integer arrays?

2015-01-07 Thread Martijn van Oosterhout
On Tue, Jan 06, 2015 at 12:09:56PM -0500, Michael Heaney wrote: I'm fairly new to Postgres, and have a design issue for which an array of integers might be a good solution. But I'd like to hear from the experts before proceeding down this path. The biggest consideration is if you are ever

Re: [GENERAL] NODE

2015-01-07 Thread Craig Ringer
On 01/06/2015 03:27 AM, Ravi Kiran wrote: * * could someone explain what exactly node mean in postgres. You can think of it like a simple abstract base class that everything else extends. Lots of PostgreSQL is pseudo-object-oriented, so you'll see this pattern around a fair bit. -- Craig

Re: [GENERAL] Loading Data Dumps for Tables Containing BDR Global Sequence

2015-01-07 Thread Craig Ringer
On 01/04/2015 12:14 AM, John Casey wrote: We have been trying to load our existing database that contains local sequences into a BDR-based database with global sequences. [snip] There just doesn’t seem to be a good way to accomplish this operation, at least not a documented way I have been

Re: [GENERAL] Improving performance of merging data between tables

2015-01-07 Thread Maxim Boguk
On Wed, Jan 7, 2015 at 8:49 PM, Pawel Veselov pawel.vese...@gmail.com wrote: PPPS: and the last suggestion, after you finished with the write all the data into its own tables, then application should perform analyze of these own tables (or you could have weird/inefficient plans during last

[GENERAL] min/max performance inequality.

2015-01-07 Thread Pawel Veselov
Hi. I was wondering how come there is such a drastic difference between finding max and min. Seems like index scan backwards is really bad... The table is freshly re-indexed just in case. I added a count(*) in there, forcing the seq scan, and it's even better than the backwards index scan... db=

Re: [GENERAL] ALTER TABLE to ADD BDR global sequence

2015-01-07 Thread Craig Ringer
On 01/07/2015 11:57 PM, John Casey wrote: I have been thinking about an alternate means of implementing global sequences that I feel would simplify things. Rather than chunking out blocks, set an increment value for each sequence equal to the number of nodes in the cluster. Each node has

Re: [GENERAL] min/max performance inequality.

2015-01-07 Thread Jeff Janes
On Wed, Jan 7, 2015 at 3:00 PM, Pawel Veselov pawel.vese...@gmail.com wrote: Hi. I was wondering how come there is such a drastic difference between finding max and min. Seems like index scan backwards is really bad... The table is freshly re-indexed just in case. I added a count(*) in

Re: [GENERAL] min/max performance inequality.

2015-01-07 Thread Pawel Veselov
Thanks Jeff (and Tom) On Wed, Jan 7, 2015 at 3:34 PM, Jeff Janes jeff.ja...@gmail.com wrote: On Wed, Jan 7, 2015 at 3:00 PM, Pawel Veselov pawel.vese...@gmail.com wrote: Hi. I was wondering how come there is such a drastic difference between finding max and min. Seems like index scan

Re: [GENERAL] min/max performance inequality.

2015-01-07 Thread Tom Lane
Pawel Veselov pawel.vese...@gmail.com writes: I was wondering how come there is such a drastic difference between finding max and min. Seems like index scan backwards is really bad... It's probably an artifact of your data distribution, ie, the blockid = 4814 condition is skipping lots of rows

Re: [GENERAL] How to exclude building/installing contrib modules on Windows

2015-01-07 Thread Michael Paquier
On Thu, Jan 8, 2015 at 6:08 AM, deepak deepak...@gmail.com wrote: I would like to exclude building and installing contrib modules on Windows. Is there an easy way to do this? I largely rely on the tools available in src\tools\msvc to build using Visual Studio 2008. Have a look at

[GENERAL] How to exclude building/installing contrib modules on Windows

2015-01-07 Thread deepak
Hi, I would like to exclude building and installing contrib modules on Windows. Is there an easy way to do this? I largely rely on the tools available in src\tools\msvc to build using Visual Studio 2008. Thanks, Deepak

Re: [GENERAL] BDR Error restarted

2015-01-07 Thread Craig Ringer
On 01/07/2015 11:28 AM, deans wrote: Hi Guys. First of all, BDR is cool, should have tried it earlier. Environment: CentOS 6.5, PostgreSQL 9.4.0 with BDR from yum repository Done the PostgreSQL 9.4 with BDR setup successfully by following the User Guide and Admin Doc, but got a issue

Re: [GENERAL] Inconsistent bgworker behaviour

2015-01-07 Thread Craig Ringer
On 01/07/2015 11:54 AM, Beena Emerson wrote: ResetLatch(MyProc-procLatch); TerminateBackgroundWorker(workers[i]-handle); WaitLatch(MyProc-procLatch, WL_LATCH_SET, 0); This doesn't guarantee that the worker of interest has terminated, just that your latch

Re: [GENERAL] postgresql versus riak for a global exchange

2015-01-07 Thread Seref Arikan
Hi Jonathan, I'm really interested in the type of hybrid architecture you've mentioned. How is the read-only index constructed in the design you're mentioning? It'd be much appreciated if you could briefly describe the order of writes/reads given postgres and non-postgres components of the

Re: [GENERAL] ALTER TABLE to ADD BDR global sequence

2015-01-07 Thread John Casey
I have been thinking about an alternate means of implementing global sequences that I feel would simplify things. Rather than chunking out blocks, set an increment value for each sequence equal to the number of nodes in the cluster. Each node has an offset. So, if you have 10 nodes, mode 1

Re: [GENERAL] NODE

2015-01-07 Thread Craig Ringer
On 01/07/2015 09:08 PM, Craig Ringer wrote: You can think of it like a simple abstract base class that everything else extends. Ahem. Every other parse/plan tree node, that is. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training

Re: [GENERAL] Advice for using integer arrays?

2015-01-07 Thread Thomas Kellerer
BTW, looking at your example, you might be more interested in ranges, see for example: http://www.postgresql.org/docs/9.2/static/rangetypes.html Conceptually they are a bit different and there isn't support for multi-ranges AFAIK You could have an array of ranges -- Sent via