Re: [EXTERNAL] Re: Numeric data types

2020-08-31 Thread Bruce Momjian
On Mon, Aug 31, 2020 at 10:20:51PM +, Godfrin, Philippe E wrote: > Frankly, I’m not certain, I believe the developers are using a messaging > intermediary. Oh, well, then you would need to find out if they are transfering the value via text or binary. It is kind of hard to extract query

RE: [EXTERNAL] Re: Numeric data types

2020-08-31 Thread Godfrin, Philippe E
Frankly, I’m not certain, I believe the developers are using a messaging intermediary. pg From: Bruce Momjian Sent: Monday, August 31, 2020 5:19 PM To: Godfrin, Philippe E Cc: pgsql-gene...@postgresql.org Subject: Re: [EXTERNAL] Re: Numeric data types On Mon, Aug 31, 2020 at 10:14:48PM +,

Re: [EXTERNAL] Re: Numeric data types

2020-08-31 Thread Bruce Momjian
On Mon, Aug 31, 2020 at 10:14:48PM +, Godfrin, Philippe E wrote: > Fabulous, thanks much. You still have not told us how you are transfering the data, so we can be sure. --- > > From: Bruce Momjian > Sent: Monday,

RE: [EXTERNAL] Re: Numeric data types

2020-08-31 Thread Godfrin, Philippe E
Fabulous, thanks much. From: Bruce Momjian Sent: Monday, August 31, 2020 4:56 PM To: Godfrin, Philippe E Cc: pgsql-gene...@postgresql.org Subject: Re: [EXTERNAL] Re: Numeric data types On Mon, Aug 31, 2020 at 05:32:23PM +, Godfrin, Philippe E wrote: > Thanks Bruce, I suppose you mean n32

Re: [EXTERNAL] Re: Numeric data types

2020-08-31 Thread Bruce Momjian
On Mon, Aug 31, 2020 at 05:32:23PM +, Godfrin, Philippe E wrote: > Thanks Bruce, I suppose you mean n32 -> n64 OK, but n64->n32 chance of 32-bit > overflow… Uh, I was thinking that your 32-bit values could roll over and the other end would be confused, but I can also see the 64-bit going

Re: Function Speed vs UI Function Speed

2020-08-31 Thread Joshua Drake
On Mon, Aug 31, 2020 at 10:32 AM Susan Hurst wrote: > > For example, a batch load script that inserts multiple rows into a table > may call an insert function within a cursor to populate each row into > the target table. Meanwhile, a non-technical business user may want to > create only one

RE: [EXTERNAL] Re: Numeric data types

2020-08-31 Thread Godfrin, Philippe E
Thanks Bruce, I suppose you mean n32 -> n64 OK, but n64->n32 chance of 32-bit overflow... pg From: Bruce Momjian Sent: Monday, August 31, 2020 11:54 AM To: Godfrin, Philippe E Cc: pgsql-gene...@postgresql.org Subject: [EXTERNAL] Re: Numeric data types On Mon, Aug 31, 2020 at 04:38:05PM +,

Function Speed vs UI Function Speed

2020-08-31 Thread Susan Hurst
Is there a significant difference in execution speed between similar functions that do the same DML but differ in the extra validations and messaging that are required for providing feedback to UI users? For example, a batch load script that inserts multiple rows into a table may call an

Re: Numeric data types

2020-08-31 Thread Bruce Momjian
On Mon, Aug 31, 2020 at 04:38:05PM +, Godfrin, Philippe E wrote: > Greetings Listees (frist time poster!) > > > > Considering the difference between 64 bit and 32 bit numeric datatypes. We > have > source databases that are running 32 bit. They send their data to a larger > cluster that

Numeric data types

2020-08-31 Thread Godfrin, Philippe E
Greetings Listees (frist time poster!) Considering the difference between 64 bit and 32 bit numeric datatypes. We have source databases that are running 32 bit. They send their data to a larger cluster that is running 64 bit. Should there be something special done in order to accommodate the

Re: How bad is using queries with thousands of values for operators IN or ANY?

2020-08-31 Thread Pavel Stehule
po 31. 8. 2020 v 13:29 odesílatel Thomas Kellerer napsal: > Thorsten Schöning schrieb am 31.08.2020 um 12:37: > > So for what query size or number of IDs to compare in IN would you > > consider a different approach at all? > > > In my experience "hundreds" of IDs tend to be quite slow if used

Re: When are largobject records TOASTed into pg_toast_2613?

2020-08-31 Thread Thomas Boussekey
Thanks Laurenz for your email Le lun. 31 août 2020 à 09:42, Laurenz Albe a écrit : > On Sat, 2020-08-29 at 21:18 +0200, Thomas Boussekey wrote: > > You can find at the end of this email, a new version of the script that > I use to remove the TOAST table on pg_largobject catalog table. > > I

Re: Query performance with min and filter

2020-08-31 Thread Tom Lane
"Yorwerth, Adam" writes: > We seem to have found a situation where a query run using explain analyse or > pgbench is incredibly fast, but run via Java under load performs very poorly > – we’ve checked query performance metrics for our Postgres instance and can > confirm that it’s the query

Re: Query performance with min and filter

2020-08-31 Thread Sengottuvelusamy, Karthikeyan
Hi Adam, What're the query times when you run the query directly on the psql prompt, but without explain/analyze? Can you check the cache hit rate vs disk read on explain analyze vs from java? Sometimes, the data's in RAM when you run a query manually, but the live Java app might be hitting

Query performance with min and filter

2020-08-31 Thread Yorwerth, Adam
Hi Postgres community, We seem to have found a situation where a query run using explain analyse or pgbench is incredibly fast, but run via Java under load performs very poorly – we’ve checked query performance metrics for our Postgres instance and can confirm that it’s the query running

Re: How bad is using queries with thousands of values for operators IN or ANY?

2020-08-31 Thread Thomas Kellerer
Thorsten Schöning schrieb am 31.08.2020 um 12:37: > So for what query size or number of IDs to compare in IN would you > consider a different approach at all? In my experience "hundreds" of IDs tend to be quite slow if used with an IN clause. Rewriting the IN to a JOIN against a VALUES clause

High Availability, guarantee to use sync nodes

2020-08-31 Thread Dirk Krautschick
Hi all, if there are several PostgreSQL nodes replicating synchronous and I configure a guarantee that for example 3 of 5 nodes have to be in sync to go on with synchronous_standby_names and now I want to implement a load balancing scenario with active standby DBs...how or with what tool can I

Re: How bad is using queries with thousands of values for operators IN or ANY?

2020-08-31 Thread Thorsten Schöning
Guten Tag Pavel Stehule, am Montag, 31. August 2020 um 10:51 schrieben Sie: > It is not good - it increases the memory necessary for query parsing, > optimizer and executor are slower. At least memory and I/O were not a problem regarding my tests, CPU-load was pretty high. But I was unable to

Re: How bad is using queries with thousands of values for operators IN or ANY?

2020-08-31 Thread Thorsten Schöning
Guten Tag Laurenz Albe, am Montag, 31. August 2020 um 10:23 schrieben Sie: > Is it an option to change that usage pattern? Not everywhere easily, because I simply have places in which I'm working with IDs only and e.g. need to check if they are owned by some user. Those checks are abstracted

Re: How bad is using queries with thousands of values for operators IN or ANY?

2020-08-31 Thread Pavel Stehule
po 31. 8. 2020 v 10:04 odesílatel Thorsten Schöning napsal: > Hi all, > > I have lots of queries in which I need to restrict access to rows > using some decimal row-ID and am mostly doing so with using the > operator IN in WHERE-clauses. Additionally I'm mostly embedding the > IDs as

Re: How bad is using queries with thousands of values for operators IN or ANY?

2020-08-31 Thread Laurenz Albe
On Mon, 2020-08-31 at 10:04 +0200, Thorsten Schöning wrote: > I have lots of queries in which I need to restrict access to rows > using some decimal row-ID and am mostly doing so with using the > operator IN in WHERE-clauses. Additionally I'm mostly embedding the > IDs as ","-seperated list into

Re: How bad is using queries with thousands of values for operators IN or ANY?

2020-08-31 Thread Tim Cross
Thorsten Schöning writes: > Hi all, > > I have lots of queries in which I need to restrict access to rows > using some decimal row-ID and am mostly doing so with using the > operator IN in WHERE-clauses. Additionally I'm mostly embedding the > IDs as ","-seperated list into the query directly,

Re: When are largobject records TOASTed into pg_toast_2613?

2020-08-31 Thread Laurenz Albe
On Sat, 2020-08-29 at 21:18 +0200, Thomas Boussekey wrote: > You can find at the end of this email, a new version of the script that I use > to remove the TOAST table on pg_largobject catalog table. > I fixed some typos and wrong synthaxes that I had typed too quickly in my > first version. > >

Re: determine what column(s) form the primary key, in C extention

2020-08-31 Thread James Sewell
> > (2) > > I'll use this C code as an example to build an extention in Rust. The > Postgresql bindings for Rust I have don't contain a definition of > `FirstLowInvalidHeapAttributeNumber` for some reason. I can define it > since it's simply single digit constant. > Not an answer to your question