Re: Add a property to automatically suspend portals as they produce given number of bytes

2025-01-17 Thread Vladimir Sitnikov
Kirill, cursor does not provide a way to limit the fetch size based on the memory consumption. Imagine a table like (id int8, value jsonb). If we use "fetch 1000", then it might require 1GiB on the client if every row contains 1MiB json. If the client plays defensively and goes for "fetch 10", it

Add a property to automatically suspend portals as they produce given number of bytes

2025-01-17 Thread Vladimir Sitnikov
Hi, Applications often face an "out of memory" condition as they try to fetch "N rows" from the database. If N is small, then the execution becomes inefficient due to many roundtrips. If N is high, there's a risk that many rows would overflow the client's memory. Note: the client can't stop readi

pg_prepared_xacts returns transactions that are foreign to the caller

2024-11-19 Thread Vladimir Sitnikov
Hi, "select * from pg_prepared_xacts" might produce transactions created by a different user, so the caller won't be able to issue "commit prepared". I think there should be a view that returns only the transactions that the caller can commit or rollback. Is it something that can be implemented a

Re: Direct SSL connection and ALPN loose ends

2024-06-25 Thread Vladimir Sitnikov
I reviewed the documentation for "direct ALPN connections' ', and it looks like it could be improved. Here's the link: https://www.postgresql.org/docs/17/protocol-flow.html#PROTOCOL-FLOW-SSL The currently suggested values for "sslnegotiations" are "direct" and "postgres". The project name is Postg

Re: When extended query protocol ends?

2024-02-28 Thread Vladimir Sitnikov
Jelte> If the Execute causes an error, is Jelte> the Query still executed or not? And what about if the Query fails, is Jelte> the Execute before committed or rolled back? Frankly, if there's a requirement from the backend, I would like it to produce a corresponding error message. What do you thi

Re: When extended query protocol ends?

2024-02-22 Thread Vladimir Sitnikov
>When splitting a multi insert statement you're going to duplicate some work I do not understand why I am going to duplicate some work. I assume the database does its best to perform all the needed preparation when processing "parse" message, and it should perform only the minimum required work wh

Re: When extended query protocol ends?

2024-02-21 Thread Vladimir Sitnikov
>Would performance suffer that much? I have not benchmarked it much, however, the driver sends "autosave" queries once (savepoint) or twice(savepoint+release) for every user-provided query. If we use extended queries (parse+bind+exec) for every savepoint, that would result in 3 or 6 messages overh

Re: When extended query protocol ends?

2024-02-21 Thread Vladimir Sitnikov
>Is it possible for the JDBC >driver to issue a Sync message before sending SAVEPOINT in simple >query protocol? Apparently, sending an extra message would increase the overhead of the protocol, thus reducing the efficiency of the application. What is the benefit of sending extra Sync? https://ww

Re: run pgindent on a regular basis / scripted manner

2023-01-24 Thread Vladimir Sitnikov
Andres> Of course, but I somehow feel a change of formatting should be reviewable to Andres> at least some degree One way of reviewing the formatting changes is to compare the compiled binaries. If the binaries before and after formatting are the same, then there's a high chance the behaviour is

Re: Experiments with Postgres and SSL

2023-01-20 Thread Vladimir Sitnikov
>You could just hard code that servers newer than a > specific version would have this support Suppose PostgreSQL 21 implements "fast TLS" Suppose pgjdbc 43 supports "fast TLS" Suppose PgBouncer 1.17.0 does not support "fast TLS" yet If pgjdbc connects to the DB via balancer, then the server woul

Re: Experiments with Postgres and SSL

2023-01-19 Thread Vladimir Sitnikov
>I don't think it's worth implementing a code path in > the server like this as it would then become cruft that would be hard > to ever get rid of. Do you think the server can de-support the old code path soon? > I think you can do the same thing, more or less, in the client. Like > if the driver

Re: Experiments with Postgres and SSL

2023-01-19 Thread Vladimir Sitnikov
It would be great if PostgreSQL supported 'start with TLS', however, how could clients activate the feature? I would like to refrain users from configuring the handshake mode, and I would like to refrain from degrading performance when a new client talks to an old database. What if the server tha

Re: PostgreSQL Limits: maximum number of columns in SELECT result

2022-05-31 Thread Vladimir Sitnikov
>ost readers are going to spend more time >wondering what the difference is between "columns per table" and "columns >per tuple" "tuple" is already mentioned 10 times on "limits" page, so adding "columns per tuple" is not really obscure. The comment could be like "for instance, max number of expre

PostgreSQL Limits: maximum number of columns in SELECT result

2022-05-31 Thread Vladimir Sitnikov
Hi, Today I hit "ERROR: target lists can have at most 1664 entries", and I was surprised the limit was not documented. I suggest that the limit of "1664 columns per tuple" (or whatever is the right term) should be added to the list at https://www.postgresql.org/docs/current/limits.html e.g. after

Re: is ErrorResponse possible on Sync?

2022-01-12 Thread Vladimir Sitnikov
>Or, does the backend swallow the error, and return only the ReadyForQuery (I hope not). What is your backend version? Here's a well-known case when the backend did swallow the error: "Error on failed COMMIT" https://www.postgresql.org/message-id/b9fb50dc-0f6e-15fb-6555-8ddb86f4aa71%40postgresfri

Re: Adding CI to our tree

2021-10-22 Thread Vladimir Sitnikov
>Just add those files to the global gitignore on your machine While global gitignore is a nice feature, it won't protect users who do not know they need to create a global ignore file. Adding explicit excludes for well-known temporary files into PostgreSQL sources makes it easier to work with the

Re: speed up verifying UTF-8

2021-08-26 Thread Vladimir Sitnikov
>Attached is v23 incorporating the 32-bit transition table, with the necessary comment adjustments 32bit table is nice. Would you please replace https://github.com/BobSteagall/utf_utils/blob/master/src/utf_utils.cpp URL with https://github.com/BobSteagall/utf_utils/blob/6b7a465265de2f5fa6133d653

Re: speed up verifying UTF-8

2021-07-26 Thread Vladimir Sitnikov
Just wondering, do you have the code in a GitHub/Gitlab branch? >+ utf8_advance(s, state, len); >+ >+ /* >+ * If we saw an error during the loop, let the caller handle it. We treat >+ * all other states as success. >+ */ >+ if (state == ERR) >+ return 0; Did you mean state = utf8_advance(s, state

Re: speed up verifying UTF-8

2021-07-21 Thread Vladimir Sitnikov
>I'm pretty confident this improvement is architecture-independent. Thanks for testing it with different architectures. It looks like the same utf8_advance function is good for both fast-path and for the slow path. Then pg_utf8_verifychar could be removed altogether along with the corresponding I

Re: speed up verifying UTF-8

2021-07-19 Thread Vladimir Sitnikov
Thank you, It looks like it is important to have shrx for x86 which appears only when -march=x86-64-v3 is used (see https://github.com/golang/go/issues/47120#issuecomment-877629712 ). Just in case: I know x86 wound not use fallback implementation, however, the sole purpose of shift-based DFA is to

Re: speed up verifying UTF-8

2021-07-15 Thread Vladimir Sitnikov
Have you considered shift-based DFA for a portable implementation https://gist.github.com/pervognsen/218ea17743e1442e59bb60d29b1aa725 ? Vladimir >

Re: Discarding DISCARD ALL

2020-12-23 Thread Vladimir Sitnikov
Simon>It seems strange to me that we put this work onto the pooler, forcing Simon>poolers to repeatedly issue the same command What if poolers learn to manage connections and prepared statements better? Then poolers won't have to reset the session every time, and everyone wins. Simon>This has an

Re: BLOB / CLOB support in PostgreSQL

2020-09-29 Thread Vladimir Sitnikov
Andrew>It needs to contain a substantial implementation plan Here's an implementation plan, again, quoted from the very same mail: Vladimir>Of course both variations above fail to support streaming Vladimir> (as in "need to process all the contents in order to get the last character"), so it migh

Re: BLOB / CLOB support in PostgreSQL

2020-09-29 Thread Vladimir Sitnikov
Andrew>You and I clearly have a different idea from what constitutes a concrete Andrew>proposal. This is hardly the ghost of a proposal. Can you please clarify what is a proposal from your point of view? Is it documented? I think I have read the relevant TODO items: https://wiki.postgresql.org/wi

Re: BLOB / CLOB support in PostgreSQL

2020-09-28 Thread Vladimir Sitnikov
>100% compatible with the MySQL It is hardly a justification for a feature or for a change request. Vladimir

Re: BLOB / CLOB support in PostgreSQL

2020-09-28 Thread Vladimir Sitnikov
Andrew>To the best of my knowledge there is no concrete proposal for the type Andrew>of data type / interface you suggest. To the best of my knowledge, one of the concrete proposals was in the very first message. Let me please copy it: Vladimir> **Here goes the question**: do you think such an

Re: BLOB / CLOB support in PostgreSQL

2020-09-28 Thread Vladimir Sitnikov
Let me please bump the thread. Just in case, I'm PgJDBC committer. PgJDBC receives requests to "support CLOB" from time to time, however, I believe it is impossible without the support from the database. To my best knowledge, the database does not have APIs for "streaming large text data". The on

Re: SIGSEGV from START_REPLICATION 0/XXXXXXX in XLogSendPhysical () at walsender.c:2762

2020-05-28 Thread Vladimir Sitnikov
Kyotaro>It seems to me that that crash means Pgjdbc is initiating a logical Kyotaro>replication connection to start physical replication. Well, it used to work previously, so it might be a breaking change from the client/application point of view. Vladimir

SIGSEGV from START_REPLICATION 0/XXXXXXX in XLogSendPhysical () at walsender.c:2762

2020-05-27 Thread Vladimir Sitnikov
Hi, Pgjdbc test suite identified a SIGSEGV in the recent HEAD builds of PostgreSQL, Ubuntu 14.04.5 LTS Here's a call stack: https://travis-ci.org/github/pgjdbc/pgjdbc/jobs/691794110#L7484 The crash is consistent, and it reproduces 100% of the cases so far. The CI history shows that HEAD was good

Re: Error on failed COMMIT

2020-03-17 Thread Vladimir Sitnikov
Bruce, thanks for taking the time to summarize. Bruce>Fourth, it is not clear how many applications would break if COMMIT Bruce>started issuing an error rather than return success None. Bruce>applications that issue COMMIT and expect success after a transaction Bruce>block has failed An applica

Re: Questions about the CI process and proposal

2020-03-07 Thread Vladimir Sitnikov
Andy>1). The test cases may succeed locally but Andy> may be failed Andy> in CI for some reasons Peter> This is not a problem I would disagree. A patch might easily make the database incompatible with clients like JDBC. Do current PostgreSQL tests catch that? I don't think so. However, that can

Re: Error on failed COMMIT

2020-02-26 Thread Vladimir Sitnikov
But if the SQL is /*commit*/rollback, then the driver should not raise an exception. The exception should be only for the case when the client asks to commit and the database can't do that. The resulting command tag alone is not enough. Vladimir

Re: Error on failed COMMIT

2020-02-26 Thread Vladimir Sitnikov
Just one more data point: drivers do allow users to execute queries in a free form. Shat is the user might execute /*comment*/commit/*comment*/ as a free-form SQL, and they would expect that the resulting behaviour should be exactly the same as .commit() API call (==silent rollback is converted to

Re: Error on failed COMMIT

2020-02-25 Thread Vladimir Sitnikov
Tom>I think we still end up concluding that altering this behavior has more Tom>downside than upside. What is the downside? Applications, drivers, and poolers already expect that commit might produce an error and terminate the transaction at the same time. "The data is successfully committed to

Re: Error on failed COMMIT

2020-02-24 Thread Vladimir Sitnikov
Robert>Now, of course, it's also true that if what the server does makes Robert>users sad, maybe the server should do something different The server makes users sad as it reports the same end result (=="commit failed") differently. Sometimes the server produces ERROR, and sometimes the server prod

Re: Error on failed COMMIT

2020-02-24 Thread Vladimir Sitnikov
>do you think most common connection poolers would continue to >work after making this change? Of course, they should. There are existing cases when commit responds with an error: deferrable constraints. There's nothing new except it is suggested to make the behavior of commit/prepare failure (e.

Re: Error on failed COMMIT

2020-02-24 Thread Vladimir Sitnikov
Merlin>My biggest sense of alarm with the proposed change is that it could Merlin>leave applications in a state where the transaction is hanging there How come? The spec says commit ends the transaction. Can you please clarify where the proposed change leaves a hanging transaction? Just in case,

Re: Error on failed COMMIT

2020-02-23 Thread Vladimir Sitnikov
Shay> Asking drivers to do this at the client have the exact same breakage impact as the server change, since the user-visible behavior changes in the same way +1 Dave>While we can certainly code around this in the client drivers I don't believe they should be responsible for fixing the failings

Re: Protect syscache from bloating with negative cache entries

2019-02-28 Thread Vladimir Sitnikov
Robert> This email thread is really short on clear demonstrations that X or Y Robert> is useful. It is useful when the whole database does **not** crash, isn't it? Case A (==current PostgeSQL mode): syscache grows, then OOMkiller chimes in, kills the database process, and it leads to the complete

Re: [Patch][WiP] Tweaked LRU for shared buffers

2019-02-16 Thread Vladimir Sitnikov
Benjamin> A related and helpful patch would be to capture the access log and Benjamin> provide anonymized traces. The traces can be captured via DTrace scripts, so no patch is required here. For instance: https://www.postgresql.org/message-id/CAB%3DJe-F_BhGfBu1sO1H7u_XMtvak%3DBQtuJFyv8cfjGBRp7Q_y

Re: extended query protcol violation?

2018-12-08 Thread Vladimir Sitnikov
>Curious what client is this that is violating the protocol. I stand corrected: that is not a violation, however client might get unexpected failure of query(begin) in a rare case of close(s1) or close(s2) fail. Vladimir

Re: extended query protcol violation?

2018-12-08 Thread Vladimir Sitnikov
Tatsuo>responses of a simple query do not include CloseComplete Tatsuo, where do you get the logs from? I guess you are just confused by the PRINTED order of the messages in the log. Note: wire order do not have to be exactly the same as the order in the log since messages are buffered, then might

Re: Libpq support to connect to standby server as priority

2018-11-20 Thread Vladimir Sitnikov
Tom>Yes, we need either session open or reconnect it approach to find out Tom>the whether server is read-write or read-only. Just in case, pgjdbc has that feature for quite a while, and the behavior there is to keep the connection until it fails or application decides to close it. pgjdbc uses thr

Re: IDE setup and development features?

2018-10-10 Thread Vladimir Sitnikov
Mori>Was wondering if anyone has had luck getting these three set up for any IDE or editor configuration? Just a data point: CLion + CMake work just great. Step by step (just checked in macOS): 1) "Check out from Version Control" -> Git -> https://github.com/stalkerg/postgres_cmake.git -> clone 2

Re: Stored procedures and out parameters

2018-09-17 Thread Vladimir Sitnikov
Merlin>The workaround is to simply not do that and you can get Merlin>precise control of behavior You are absolutely right. On top of that, the whole concept of DB-drivers and libpq is useless. Users should just simply exchange wire messages for precise control of behavior. Vladimir

Re: Stored procedures and out parameters

2018-08-29 Thread Vladimir Sitnikov
David>JDBC driver or similar drivers to use the CALL command always from PG11 on, then the meaning of {call f1(a, b)} will have changed and a Note: technically speaking, JDBC has two flavours of syntax (however standard does not clarify the distinction): S1) {? := call my_proc(?,?) } S2) { call my

Re: Stored procedures and out parameters

2018-08-22 Thread Vladimir Sitnikov
Peter>AFAICT in no case does it involve allowing functions to be called as procedures or vice versa. Oracle DB uses the same way to execute both procedures and functions: pl/sql block. For instance: procedure) begin my_proc(); end; function) begin :result := my_fun(); end; Call like begin my_fun

Re: Stored procedures and out parameters

2018-08-16 Thread Vladimir Sitnikov
Shay>On the other hand, releasing *without* this also has its consequence, namely setting in stone that the database-independent language API cannot be used for invoking the new stored procedures Shay>So I hope you at least consider going through the thought process about allowing this. +1 I wond

Re: Stored procedures and out parameters

2018-08-16 Thread Vladimir Sitnikov
Peter>I am familiar with the Java {call} escape. But I think it's pretty Peter>useless. You're not going to get any compatibility with anything from Peter>it, since every SQL implementation does something different with it Would you please be more specific? { call ... } converts the SQL to the

Re: Stored procedures and out parameters

2018-08-02 Thread Vladimir Sitnikov
Shay>Npgsql currently always sends a describe as part of statement execution (for server-prepared messages the describe is done only once, at preparation-time). Vladimir, are you doing things differently here? The same thing is for pgjdbc. It does use describe to identify result row format. Howeve

BLOB / CLOB support in PostgreSQL

2018-07-25 Thread Vladimir Sitnikov
ecomes 2 bytes always), however it would come at a cost of space usage. **Here goes the question**: do you think such an implementation ("large string stored in Large Objects" could be merged into the core eventually)? Q2: any ideas/existing libraries for random access read-write large strings stored as binary? PS. Relevant pgjdbc PR is https://github.com/pgjdbc/pgjdbc/pull/1272 -- Regards, Vladimir Sitnikov

Re: Stored procedures and out parameters

2018-07-24 Thread Vladimir Sitnikov
>to compensate for the decisions made by the JDBC driver PostgreSQL It is not a decision by PostgreSQL JDBC driver. It is a decision by JDBC (Java Database Connectivity) specification itself. pgjdbc just follows the specification there. Well, there's an initiative for a new JDBC specification (AD

Re: Stored procedures and out parameters

2018-07-23 Thread Vladimir Sitnikov
Andrew>does it fail on the latest 11-stable 1) Current "build from Git/master PostgreSQL" produces the data row for both simple and extended queries. 2) Just a side note: `CALL my_proc()` is not suitable for functions. That looks weird. Is the client expected to lookup system catalogs in order to

Re: [JDBC] [HACKERS] PGSERVICEFILE as a connection string parameter

2018-05-28 Thread Vladimir Sitnikov
David>I'm guessing that the Java port wouldn't be too complicated. It's already well defined. Is encoding defined somewhere for the "service file"? I don't like the idea of using "a default" very much. Vladimir

Re: Subplan result caching

2018-05-23 Thread Vladimir Sitnikov
>I like the idea. +1 >Also, there probably should be a GUC for this, defaulting to "off". I think the feature could be on by default provided it can properly identify "volatile" functions/tables hidden behind views. Vladimir

Re: Having query cache in core

2018-05-11 Thread Vladimir Sitnikov
> If any of the tables were modified, cache entries using the table must be removed. > (these are already implemented in Pgpool-II's in memory query cache) How do you identify updates made from a pl/pgsql procedure? Vladimir

Re: [HACKERS] Clock with Adaptive Replacement

2018-05-08 Thread Vladimir Sitnikov
>I have work loads that I can repeat, so I can help with testing. That would be great. Do you think you could use DTrace to capture the trace? For instance, https://github.com/vlsi/pgsqlstat/blob/pgsqlio/pgsqlio Vladimir

Re: [HACKERS] Clock with Adaptive Replacement

2018-05-08 Thread Vladimir Sitnikov
> Oh, looks like I'm inventing another kind of bicycle :-( Do you think you could capture a trace or two from a more-or-less representative application/database? Discussion of algorithms makes little sense as we all lack traces to compare/validate. Vladimir

Re: [HACKERS] Clock with Adaptive Replacement

2018-05-04 Thread Vladimir Sitnikov
>I don't have time to check this out just now, but it seems like an excellent idea There are a couple of sad things: 1) DTrace probes seem to be disabled by default. At least, I had to build PostgreSQL with --enable-dtrace in my macOS. Does that (the requirement to enable dtrace within PostgreSQL)

Re: GSoC 2018: thrift encoding format

2018-05-04 Thread Vladimir Sitnikov
>I mean Charles is free to choose the interface for the extension he believes is right I'm just trying to figure out what are the use cases for using that Thrift extension. For instance, it would be interesting if Thrift was an alternative way to transfer data between client and the database. I g

Re: GSoC 2018: thrift encoding format

2018-05-03 Thread Vladimir Sitnikov
>Personally I think raw data bytes are OK if functions for getting all keys and values from this data are provided What is the purpose of using Thrift "encoding" if it turns out to be a simple wrapper for existing binary data? Do you mean the goal is to have "get/set" functions to fetch data out

Re: [HACKERS] Clock with Adaptive Replacement

2018-05-02 Thread Vladimir Sitnikov
>If somebody produced a trace showing the buffer lookups in order To get things moving, I've created a DTrace script that captures buffer reads: https://github.com/vlsi/pgsqlstat/blob/pgsqlio/pgsqlio Is it something that can be used to capture live traces? Sample output can be seen here: https:/

Re: Built-in connection pooling

2018-04-20 Thread Vladimir Sitnikov
>Development in built-in connection pooling will be continued in https://github.com/postgrespro/postgresql.builtin_pool.git The branch (as of 0020c44195992c6dce26baec354a5e54ff30b33f) passes pgjdbc tests: https://travis-ci.org/vlsi/pgjdbc/builds/368997672 Current tests are mostly single-threaded,

Re: Built-in connection pooling

2018-04-19 Thread Vladimir Sitnikov
Christopher>One of the things that they find likable is that by having the connection pool live Christopher>in the framework alongside the application is that this makes it easy to attach Christopher>hooks so that the pool can do intelligent things based on application-aware logic. I'm afraid I do

Re: [HACKERS] Insert values() per-statement overhead

2018-04-01 Thread Vladimir Sitnikov
Andres>I think the biggestoverhead here is that the executor startup includes Andres>too many indirect (linked lists) datastructured, that allocated each Andres>round The case is very common: batch inserts are popular in Java, and ORMs use batch API automatically. However, there's high per-backend

Re: Proposal: http2 wire format

2018-03-26 Thread Vladimir Sitnikov
Damir>Wouldn’t that be protocol semantics? Framing is already taken care of by the wire protocol. Apparently I'm using the wrong word. I do mean protocol semantics. Damir>But can you pull off grpc.. Would it be the only protocol supported? Of course there will be lots of "older clients" For inst

Re: Proposal: http2 wire format

2018-03-26 Thread Vladimir Sitnikov
It could make sense to arrange a Google Hangouts conversation (or alike). Hangouts allows to record sessions with up to 10 speakers and unlimited listeners. The recording can be shared via YouTube. Damir>Funny you agree with that—for someone having the experience of writing a driver and having a l

Re: Proposal: http2 wire format

2018-03-26 Thread Vladimir Sitnikov
Tom>But starting from the assumption that HTTP2 solves our problems seems to me to be "Here's a hammer. Agree. Just a side note: if v4 is ever invented I wish client language support is considered. It does take resources to implement message framing, and data parsing (e.g. int, timestamp, struct,

Re: Proposal: http2 wire format

2018-03-26 Thread Vladimir Sitnikov
Damir>Postgres doesn’t know about grpc, s I'm afraid you are missing the point. I would say PostgreSQL doesn't know about HTTP/2. It is the same as "PostgreSQL doesn't know about grpc". Here's a quote from your pg_h2 repo: >What we need is to really build a request object and correctly extract >

Re: Proposal: http2 wire format

2018-03-26 Thread Vladimir Sitnikov
Damir> * What are the criteria for getting this into the core? Craig>Mine would be: +1 There's a relevant list as well: https://github.com/pgjdbc/pgjdbc/blob/master/backend_protocol_v4_wanted_features.md Vladimir

Re: Proposal: http2 wire format

2018-03-26 Thread Vladimir Sitnikov
Hi, >If anyone finds the idea of Postgres speaking http2 appealing HTTP/2 sounds interesting. What do you think of https://grpc.io/ ? Have you evaluated it? It does sound like a ready RPC on top of HTTP/2 with support for lots of languages. The idea of reimplementing the protocol for multiple l

Re: Backend memory dump analysis

2018-03-25 Thread Vladimir Sitnikov
Tom>One concrete objection to the above is it'd obscure hierarchical relationships in the context tree, What is the problem with relationships? Context names are aligned as well provided 8192 is justified to 6-7-8-9 (you pick) characters. Tom>But given the lack of previous complaints 1) Here it

Re: Backend memory dump analysis

2018-03-25 Thread Vladimir Sitnikov
Tom>Well, as I said, you can do anything you want now in an extension. That is true. However it basically means "everybody who cares to troubleshoot the memory use of a production system should install an extension". Should https://wiki.postgresql.org/wiki/Developer_FAQ#Examining_backend_memory_us

Re: Backend memory dump analysis

2018-03-25 Thread Vladimir Sitnikov
It looks much better. >While I didn't do anything about it here, I think it'd likely be a >good idea for MemoryContextStats printout to truncate the context ID >strings at 100 characters or so It would be great if there was an option to show full sql. For instance, current statistics is not sorte

Re: Backend memory dump analysis

2018-03-23 Thread Vladimir Sitnikov
Andres>The overhead required for it (in cycles, in higher memory usage due to additional bookeeping Does that mean the memory contexts are unparseable? (there's not enough information to enumerate contents) What if memory dump is produced by walking the C structures? For instance, I assume statam

Backend memory dump analysis

2018-03-23 Thread Vladimir Sitnikov
Hi, I investigate an out of memory-related case for PostgreSQL 9.6.5, and it looks like MemoryContextStatsDetail + gdb are the only friends there. MemoryContextStatsDetail does print some info, however it is rarely possible to associate the used memory with business cases. For insance: CachedP

max_memory_per_backend GUC to limit backend's memory usage

2018-03-23 Thread Vladimir Sitnikov
Hi, I've got a problem with PostgreSQL 9.6.5: backend gets killed by OOM killer, and it shuts the DB down. Of course, the OOM case is to be investigated (MemoryContextStatsDetail, etc), however I wonder if DB can be more robust. The sad thing is a single backend crash results in the DB shutdown, s

Re: [GSoC Idea Discussion] "Thrift datatype support" Project

2018-02-13 Thread Vladimir Sitnikov
Technically speaking, Thrift is "language-independent" serialization-deserialization format with clean approach to backward compatibility. I think Thrift (or something like that) can be useful, as it can generate serializers/deserializers for lots of languages. PostgreSQL's "binary" format is tied

Re: Built-in connection pooling

2018-02-02 Thread Vladimir Sitnikov
Konstantin>I do not have explanation of performance degradation in case of this particular workload. A) Mongo Java Client uses a connection-pool of 100 connections by default. That is it does not follow "connection per client" (in YCSB terms), but it is capped by 100 connections. I think it can be

Re: Built-in connection pooling

2018-02-01 Thread Vladimir Sitnikov
> config/pgjsonb-local.dat Do you use standard "workload" configuration values? (e.g. recordcount=1000, maxscanlength=100) Could you share ycsb output (e.g. for workload a)? I mean lines like [TOTAL_GC_TIME], Time(ms), xxx [TOTAL_GC_TIME_%], Time(%), xxx >postgresql-9.4.1212.jar Ok, you have re

Re: Built-in connection pooling

2018-02-01 Thread Vladimir Sitnikov
Konstantin>I have not built YCSB myself, use existed installation. Which pgjdbc version was in use? Konstantin>One of the main problems of Postgres is significant degrade of performance in case of concurrent write access by multiple transactions to the same sows. I would consider that a workload

Re: Built-in connection pooling

2018-02-01 Thread Vladimir Sitnikov
Konstantin>I have obtained more results with YCSB benchmark and built-in connection pooling Could you provide more information on the benchmark setup you have used? For instance: benchmark library versions, PostgreSQL client version, additional/default benchmark parameters. Konstantin>Postgres sh

Re: Built-in connection pooling

2018-01-29 Thread Vladimir Sitnikov
Bruce>Well, we could have the connection pooler disconnect those, right? I agree. Do you think we could rely on all the applications being configured in a sane way? A fallback configuration at DB level could still be useful to ensure the DB keeps running in case multiple applications access it. It

Re: Built-in connection pooling

2018-01-29 Thread Vladimir Sitnikov
Bruce>Yes, it would impact applications and you are right most applications could not handle that cleanly. I would disagree here. We are discussing applications that produce "lots of idle" connections, aren't we? That typically comes from an application-level connection pool. Most of the connectio

Re: jdbc targetServerType=slave with readonly connection

2018-01-16 Thread Vladimir Sitnikov
>the slave replication server does not seem to be recognized correctly Could you elaborate on what do you mean by "does not seem to be recognized correctly"? You might be hitting https://github.com/pgjdbc/pgjdbc/pull/844 , so would you please check if pgjdbc 42.2.0-SNAPSHOT (e.g. https://oss.sona

Re: portal pinning

2018-01-10 Thread Vladimir Sitnikov
> committed I'm afraid it causes regressions for pgjdbc. Here's CI log: https://travis-ci.org/pgjdbc/pgjdbc/jobs/327327402 The errors are: testMetaData[typeName = REF_CURSOR, cursorType = 2,012](org.postgresql.test.jdbc2.RefCursorTest) Time elapsed: 0.032 sec <<< ERROR! org.postgresql.util.PSQL