Re: [GENERAL] Help with slow table update

2015-04-17 Thread Pawel Veselov
> > [skipped] > > >> But remember that if you update or delete a row, removing it from an >>> index, the data will stay in that index until vacuum comes along. >>> >>> Also, there's no point in doing a REINDEX after a VACUUM FULL; >>> vacuum full rebuilds all the indexes for you. >

Re: [GENERAL] Help with slow table update

2015-04-15 Thread Pawel Veselov
> > [skipped] > > > > This is where using sets becomes really tedious, as Postgres severely > lacks an upsert-like statement. > > I don't think there are joins allowed in UPDATE statement, so I will need > to use WITH query, right? > > Also, I'm not sure how LEFT JOIN will help me isolate and inser

Re: [GENERAL] Help with slow table update

2015-04-14 Thread Pawel Veselov
On Tue, Apr 14, 2015 at 3:29 PM, Jim Nasby wrote: > On 4/14/15 4:44 PM, Pawel Veselov wrote: > >> On Tue, Apr 14, 2015 at 1:15 PM, Jim Nasby > <mailto:jim.na...@bluetreble.com>> wrote: >> >> On 4/14/15 1:28 PM, Pawel Veselov wrote: >> >> >&

Re: [GENERAL] Help with slow table update

2015-04-14 Thread Pawel Veselov
On Tue, Apr 14, 2015 at 1:15 PM, Jim Nasby wrote: > On 4/14/15 1:28 PM, Pawel Veselov wrote: > >> >> I wonder if what I need to do, considering that I update a lot of "the >> same" rows as I process this queue, is to create a temp table, update >> th

Re: [GENERAL] Help with slow table update

2015-04-14 Thread Pawel Veselov
On Mon, Apr 13, 2015 at 7:37 PM, Jim Nasby wrote: > On 4/13/15 7:01 PM, Pawel Veselov wrote: > >> Cursors tend to make things slow. Avoid them if you can. >> >> >> Is there an alternative to iterating over a number of rows, where a >> direct update qu

Re: [GENERAL] Help with slow table update

2015-04-14 Thread Pawel Veselov
On Mon, Apr 13, 2015 at 6:03 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Mon, Apr 13, 2015 at 5:01 PM, Pawel Veselov > wrote: > >> >> r_agrio_hourly - "good", r_agrio_total - "bad". >> >> Update on r_agrio_hourly (

Re: [GENERAL] Help with slow table update

2015-04-13 Thread Pawel Veselov
On Sun, Apr 12, 2015 at 5:40 PM, Jim Nasby wrote: > On 4/9/15 6:18 PM, Pawel Veselov wrote: > >> Hi. >> >> I have a plpgsql procedure that updates a few similar tables. >> for some reason, updates on one of the tables take a lot longer the >> updates on the o

[GENERAL] bigserial continuity safety

2015-04-13 Thread Pawel Veselov
Hi. If I have a table created as: CREATE TABLE xq_agr ( idBIGSERIAL PRIMARY KEY, node text not null ); and that multiple applications insert into. The applications never explicitly specify the value for 'id'. Is it safe to, on a single connection, do: - open tra

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

2015-02-10 Thread Pawel Veselov
Sorry, it took me a while to respond, but I re-factored all of this process to suggestions. On Wed, Jan 7, 2015 at 7:49 PM, Maxim Boguk wrote: > > On Wed, Jan 7, 2015 at 8:49 PM, Pawel Veselov > wrote: >> >> PS: your setup look pretty complicated and hard to analyze w

Re: [GENERAL] Casting hstore to json

2015-01-16 Thread Pawel Veselov
Adrian, On Thu, Jan 15, 2015 at 9:09 PM, Adrian Klaver wrote: > On 01/15/2015 07:59 PM, Pawel Veselov wrote: > >> Hi. >> >> I'm trying to cast hstore to json, but I don't seem to be getting a json >> object from hstore key/value pairs. >> >&g

[GENERAL] Casting hstore to json

2015-01-15 Thread Pawel Veselov
;, \"b\"=>\"2\"" (1 row) db=> SELECT cast(('"a"=>1, "b"=>2'::hstore) as json); ERROR: cannot cast type hstore to json LINE 1: SELECT cast(('"a"=>1, "b"=>2'::hstore) as json); Thanks! Pawel.

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 wrote: > On Wed, Jan 7, 2015 at 3:00 PM, Pawel Veselov > wrote: > >> Hi. >> >> I was wondering how come there is such a drastic difference between >> finding max and min. Seems like "inde

[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] Improving performance of merging data between tables

2015-01-07 Thread Pawel Veselov
On Tue, Dec 30, 2014 at 7:25 PM, Maxim Boguk wrote: > > On Wed, Dec 31, 2014 at 11:10 AM, Pawel Veselov > wrote >> >> >> [skipped] >> >> 2) try pg_stat_statements, setting "pg_stat_statements.track = all". see: >>>> http://www.pos

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

2014-12-30 Thread Pawel Veselov
On Mon, Dec 29, 2014 at 9:29 PM, Pawel Veselov wrote: [skipped] >>> 1) How do I find out what exactly is consuming the CPU in a PL/pgSQL >>> function? All I see is that the calls to merge_all() function take long >>> time, and the CPU is high while this is going on

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

2014-12-29 Thread Pawel Veselov
Andy, thanks for looking into this. On Mon, Dec 29, 2014 at 9:00 AM, Andy Colson wrote: > On 12/28/2014 3:49 PM, Pawel Veselov wrote: > >> Hi. >> >> I was wondering if anybody would have any ideas on how to improve >> certain operations that we are having. >>

[GENERAL] Improving performance of merging data between tables

2014-12-28 Thread Pawel Veselov
re used as foreign keys, hence the loops. I suspect the looping is CPU intensive. Thank you, Pawel.

[GENERAL] documentation for lo_* functions

2014-11-17 Thread Pawel Veselov
Hi. Where is the proper documentation for lo_* functions (e.g. lo_open) that are available as SQL functions? I see libpq functions documented in /static/lo-interfaces.html, but not the SQL ones (from pg_catalog). Thank you, Pawel.

[GENERAL] incremental digest (and other) functions?

2014-11-17 Thread Pawel Veselov
see those, IMHO. Or may be I missed them? Thank you, Pawel.

[GENERAL] ORDER BY expression required in SELECT if DISTINCT

2013-03-17 Thread Pawel Veselov
7; AND t2.frontState = 'PUBLISHED' AND t0.package_name = t5.APP_PACKAGE_NAME AND ts_match_vq(t5.search_vector, to_tsquery('aaa')) AND 1 = 1) ORDER BY ts_rank(t5.search_vector, to_tsquery('aaa')) ASC Thank you, Pawel.

Re: [GENERAL] Understanding streaming replication

2012-11-12 Thread Pawel Veselov
On Mon, Nov 12, 2012 at 10:11 AM, Pawel Veselov wrote: > > On Mon, Nov 12, 2012 at 1:36 AM, Albe Laurenz wrote: > >> I'll try to answer the questions I can. >> > > Thank you! > > >> Pawel Veselov wrote: >> > I've been struggling wi

Re: [GENERAL] Understanding streaming replication

2012-11-12 Thread Pawel Veselov
On Mon, Nov 12, 2012 at 1:36 AM, Albe Laurenz wrote: > I'll try to answer the questions I can. > Thank you! > Pawel Veselov wrote: > > I've been struggling with understanding all the necessary pieces for > streaming replication. So I put > > down the pieces a

[GENERAL] Understanding streaming replication

2012-11-09 Thread Pawel Veselov
ecovery, and re-start the stand-by node. I am not sure if there is a good way to check if that node has already been recovered. That because if there are more than 2 pgpools, they both will attempt to recover the same stand-by, and this will probably get ugly. Thank you, Pawel.

[GENERAL] how to connect to oracle database

2012-07-24 Thread Pawel Kopka
Hi, I have one question. Is there any possibility to connect from postgresql function (plpgsql) to oracle database with help of dblink? Pawel Kopka

Re: [GENERAL] index update

2012-07-17 Thread Pawel Veselov
On Tue, Jul 17, 2012 at 9:18 PM, Craig Ringer wrote: > On 07/18/2012 12:02 PM, Pawel Veselov wrote: > > Hi. > > If I have a lot (10k) tables, and each table has a btree index, and all > the tables are being constantly inserted into, would all the indexes have > to be

[GENERAL] index update

2012-07-17 Thread Pawel Veselov
Hi. If I have a lot (10k) tables, and each table has a btree index, and all the tables are being constantly inserted into, would all the indexes have to be in memory, and would effectively start fighting for space? Thank you, Pawel.

Re: [GENERAL] errors with high connections rate

2012-07-03 Thread Pawel S. Veselov
On 07/03/2012 12:34 AM, Craig Ringer wrote: On 07/03/2012 03:19 PM, Pawel Veselov wrote: Hi. -- problem 1 -- I have an application, using libpq, connecting to postgres 9.1.3 (Amazon AMI distro). The application writes data at a high rate (at this point it's 500 transaction per s

Re: [GENERAL] errors with high connections rate

2012-07-03 Thread Pawel S. Veselov
switch to a connection pool model in such a case, just to not over-fork postgres, however, I don't see that postgres is consuming any significant amount of system resources by forked server processes. Thank you, Pawel. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.o

[GENERAL] errors with high connections rate

2012-07-03 Thread Pawel Veselov
ket actually finishing the connection? If running under strace, I never see EINPROGRESS returned from connect(), and the only reason sendto() would result into ENOTCONN is when the connect didn't finish, and the socket was deemed "connected" using poll/getsockopt... Thanks, Pawel.

Re: [GENERAL] 31.11. Notice Processing - associating notices with calls

2012-06-25 Thread Pawel Veselov
On Mon, Jun 25, 2012 at 8:07 AM, Tom Lane wrote: > Pawel Veselov writes: > > What's the best way to "associate" an incoming notice with the statement > > that resulted in generating it? > > Um ... the first issue with this problem statement is the assumptio

[GENERAL] 31.11. Notice Processing - associating notices with calls

2012-06-25 Thread Pawel Veselov
MT) "flag" that would tell the receiver what statement was executed last? I assume that the execution path is that notice call back is invoked while the statement function executes. Thank you, Pawel.

[GENERAL] Limited number of simultaneous connections on Windows

2011-06-21 Thread Pawel Kukawski
Hello, I have recently read about limited number of simultaneous connections on Windows when postgres is running as a service. Link is available here: http://wiki.postgresql.org/wiki/Running_%26_Installing_PostgreSQL_On_Native_Windows#I_cannot_run_with_more_than_about_125_connections_at_once.2C_de

Re: [GENERAL] plz, Help!! HOW CAN I GET THE ROWNUM IN POSTGRES TABLE AS I DID WITH ORACLE!!

2000-11-24 Thread Pawel Dubin
List z dnia: Pi? 24. Listopad 2000 05:51, : > On Fri, Nov 24, 2000 at 08:35:34AM +0300, some SMTP stream spewed forth: > > On Mon, Nov 20, 2000 at 12:44:20PM +0800, BaiJie wrote: > > > I KNOW THERE IS A OID FIELD ,BUT IT 'S WIRED , NOT A INTEGER INDEX FROM > > > I TO CURRENT ROW NUMBER!! HOW CAN

[GENERAL] latest version?

2000-10-24 Thread Pawel Wegrzyn
Hi, What is the latest version of PostgreSQL? Is there something like 7.1? Pawel

[GENERAL] query buffer max length of 16384 exceeded

1999-12-17 Thread pawel
s a lot pawel

[GENERAL] Precompilation error (ecpg)

1999-12-13 Thread pawel
ode with Oracle. I would appreciate any feedback. thanks pawel ecpg_test.pc file - #include #include typedef struct { int zip; } zipcode_record; EXEC SQL INCLUDE sqlca; void add_customer(); void main() { /* just a test */ } void add_customer() { EXEC SQL BEG