Re: Performance implications of 8K pread()s

2023-07-17 Thread Andres Freund
subset thereof). >From what I know of btrfs, I don't think you want direct IO though. Possibly for WAL, but definitely not for data. IIRC it currently can cause corruption. Greetings, Andres Freund

Re: How to reduce latency with fast short queries in Postgresql 15.3 on a NUMA server

2023-05-31 Thread Andres Freund
if you bind both server and client to the same CPU socket. numactl --membind 1 --cpunodebind 1 forces programs to allocate memory and run on a specific CPU socket. Greetings, Andres Freund

Re: Fsync IO issue

2023-05-04 Thread Andres Freund
ale does flush WAL too frequently for some reason... Greetings, Andres Freund

Re: speeding up grafana sensor-data query on raspberry pi 3

2023-04-16 Thread Andres Freund
t might be beneficial to increase effective_io_concurrency some. > Recheck Cond: ((ts >= '2023-03-16 > 10:51:28.397+01'::timestamp with time zone) AND (ts <= '2023-04-16 > 10:51:28.397+02'::timestamp with time zone)) > Rows Removed by Index Recheck: 2131 > Heap Blocks: lossy=4742 The lossiness might also incur some overhead, so increasing work_mem a bit will help some. Greetings, Andres Freund

Re: For loop execution times in PostgreSQL 12 vs 15

2023-02-13 Thread Andres Freund
Hi, On 2023-02-10 20:45:39 +0100, Pavel Stehule wrote: > But for significant improvements it needs some form of JIT (Postgres has JIT > for SQL expressions, but it is not used for PLpgSQL expressions). On second > hand, PL/pgSQL is not designed (and usually) not used for extensive numeric >

Re: max_wal_senders

2023-02-08 Thread Andres Freund
mory. There's a small degradation of performance due to the increased size of some shared datastructures, most prominently the lock table for heavyweight locks. Greetings, Andres Freund

Re: Catching up with performance & PostgreSQL 15

2022-11-30 Thread Andres Freund
Hi, On November 30, 2022 3:47:32 AM PST, Andrew Dunstan wrote: > >On 2022-11-29 Tu 16:06, David Rowley wrote: >> On Wed, 30 Nov 2022 at 03:31, Tom Lane wrote: >>> Alvaro Herrera writes: IMO it was a mistake to turn JIT on in the default config, so that's one thing you'll likely want

Re: pgbench: could not connect to server: Resource temporarily unavailable

2022-08-21 Thread Andres Freund
onnections are made, and thus how quickly the backlog is filled. Do you get the same behaviour if you set net.core.somaxconn to higher than the number of connections? IIRC you need to restart postgres for it to take effect. Greetings, Andres Freund

Re: to_jsonb performance on array aggregated correlated subqueries

2022-08-12 Thread Andres Freund
a simple LEFT JOINed query when > under high load (> 1000 queries / sec). Furthermore the CPU usage is quite > high. We can't say much about aurora. It's a heavily modified fork of postgres. Did you reproduce this with vanilla postgres? And if so, do you have it in a form that somebody could try out? Greetings, Andres Freund

Re: Any way to speed up INSERT INTO

2022-03-04 Thread Andres Freund
Hi, On March 4, 2022 10:42:39 AM PST, Tom Lane wrote: >aditya desai writes: >> One of the service layer app is inserting Millions of records in a table >> but one row at a time. Although COPY is the fastest way to import a file in >> a table. Application has a requirement of processing a row

Re: LwLockRelease performance

2021-12-02 Thread Andres Freund
cks, but instead just swapping in the currently-last lock. Greetings, Andres Freund (*) IIRC the issue is when writing back we try to write back multiple buffers at once (using conditional lock acquisition to avoid deadlocks). Those then are likely released in FIFO order. I think it's now not a problem anymore

Re: Lock contention high

2021-10-27 Thread Andres Freund
Hi, On October 27, 2021 2:44:56 PM PDT, Ashkil Dighin wrote: >Hi, >Yes, lock contention reduced with postgresqlv14. >Lock acquire reduced 18% to 10% >10.49 %postgres postgres[.] LWLockAcquire >5.09% postgres postgres[.] _bt_compare > >Is lock contention can be

Re: Lock contention high

2021-10-25 Thread Andres Freund
Hi, On 2021-10-25 18:38:40 -0600, Michael Lewis wrote: > On Mon, Oct 25, 2021, 5:36 PM Andres Freund wrote: > If your hot data set is actually larger than s_b, I'd recommend trying a > larger s_b. It's plausible that a good chunk of lock contention is from > that. > How much larg

Re: Lock contention high

2021-10-25 Thread Andres Freund
gt; Postgres.conf used in Baremetal > > shared_buffers = 128GB(1/4 th RAM size) > effective_cachesize=392 GB(1/3 or 75% of RAM size) If your hot data set is actually larger than s_b, I'd recommend trying a larger s_b. It's plausible that a good chunk of lock contention is from that. Greetings, Andres Freund

Re: LWLocks by LockManager slowing large DB

2021-04-13 Thread Andres Freund
Hi, On 2021-04-13 23:04:50 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2021-04-13 19:16:46 -0400, Tom Lane wrote: > >> Like this? This passes check-world, modulo the one very-unsurprising > >> regression test change. I've not tried to do any performan

Re: LWLocks by LockManager slowing large DB

2021-04-13 Thread Andres Freund
ng. I wonder if there's a realistic chance it could create additional deadlocks that don't exist right now? Would it be a problem that we'd still release the locks on catalog tables early, but not on its toast table? Greetings, Andres Freund

Re: LWLocks by LockManager slowing large DB

2021-04-13 Thread Andres Freund
ted improvement? The ability to lock a toast table? Yea, it might be worth doing that. I seem to recall this being discussed not too long ago... Greetings, Andres Freund

Re: LWLocks by LockManager slowing large DB

2021-04-13 Thread Andres Freund
Hi, On 2021-04-13 09:33:48 -0700, Paul Friedman wrote: > I've attached the 2 perf reports. From the 2nd one, I can see lots of > time waiting for TOAST table locks on the geometry column, but I > definitely don't fully understand the implications or why LockManager > would be struggling here.

Re: LWLocks by LockManager slowing large DB

2021-04-12 Thread Andres Freund
n turn is what lwlocks end up using on linux when the lock is contended. Check the second half of: https://www.postgresql.org/message-id/20210412215738.xytq33wlciljyva5%40alap3.anarazel.de Greetings, Andres Freund

Re: LWLocks by LockManager slowing large DB

2021-04-12 Thread Andres Freund
n't just the first few milliseconds of starting those 60 queries, there shouldn't be any additional "heavyweight locks" taken given the duration of your queries. The futex profile hopefully will tell us from where that is coming from... Greetings, Andres Freund

Re: LWLocks by LockManager slowing large DB

2021-04-12 Thread Andres Freund
-graph dwarf -e syscalls:sys_enter_futex -a sleep 3 perf report --no-children --sort comm,symbol Greetings, Andres Freund

Re: NUMA settings

2020-05-04 Thread Andres Freund
Hi, On 2020-04-29 10:50:54 +0200, Laurenz Albe wrote: > On Wed, 2020-04-29 at 08:54 +0200, Marc Rechté wrote: > > I am trying to figure out the recommended settings for a PG dedicated > > machine regarding NUMA. > > > > I assume that the shared buffers are using Huge Phages only. Please > >

Re: How to avoid UPDATE performance degradation in a transaction

2020-02-19 Thread Andres Freund
of common code/infrastructure between deleting row versions that are invisible due to no backend having a snapshot to see them (presumably inferred via xmin/xmax), and newly created row versions within a transaction that are invisible because there's no snapshot with that cid. Greetings, Andres Freund

Re: How to set parallel_tuple_cost

2019-12-20 Thread Andres Freund
es the input slot to be materialized into a HeapTuple (should probably be MinimalTuple), which often the input will not yet be. So I think it'll often be much worse than 10x. Greetings, Andres Freund

Re: Consecutive Query Executions with Increasing Execution Time

2019-12-16 Thread Andres Freund
Hi, On 2019-12-16 17:48:16 -0500, Tom Lane wrote: > Hmm, that's an interesting thought. The OP did say the CPU type, > but according to Intel's spec page for it [1] the difference between > base and turbo frequency is only 4.0 vs 4.2 GHz, which doesn't seem > like enough to explain the results

Re: Simple DELETE on modest-size table runs 100% CPU forever

2019-11-14 Thread Andres Freund
gories.category_id unique? Does the plan change if you ANALYZE the tables? This plan doesn't look like it'd actually take long, if the estimates are correct. > What on Earth could be causing this simple query to be running 100% CPU for > hours? Is the DELETE actually taking that long, or the query you showed the explain for, or both? Greetings, Andres Freund

Re: FPGA optimization ...

2019-11-06 Thread Andres Freund
everyone using PG, even without access to special purpose hardware. Greetings, Andres Freund

Re: Huge shared hit for small table

2019-11-04 Thread Andres Freund
gstattuple.html not the pg_stat_user_indexes entry... Greetings, Andres Freund

Re: Huge shared hit for small table

2019-11-04 Thread Andres Freund
the preceding message contains > advice relating to a Federal tax issue, unless expressly stated otherwise the > advice is not intended or written to be used, and it cannot be used by the > recipient or any other taxpayer, for the purpose of avoiding Federal tax > penalties, and was not written to support the promotion or marketing of any > transaction or matter discussed herein. GNGNGGRR. Greetings, Andres Freund

Re: Extremely slow HashAggregate in simple UNION query

2019-08-24 Thread Andres Freund
Hi, On August 24, 2019 12:41:03 PM PDT, Tom Lane wrote: >Jeff Janes writes: >> Most of the time is not after the clock stops, but before the >stepwise >> ANALYZE clock starts. If you just do an EXPLAIN rather than EXPLAIN >> ANALYZE, that is also slow. The giant hash table is created during

Re: Extremely slow HashAggregate in simple UNION query

2019-08-20 Thread Andres Freund
Hi, On 2019-08-20 19:55:56 +0200, Felix Geisendörfer wrote: > > On 20. Aug 2019, at 19:32, Andres Freund wrote: > > FWIW, that's not a mis-estimate I'm getting on master ;). Obviously > > that doesn't actually address your concern... > > I suppose this is thanks to t

Re: Extremely slow HashAggregate in simple UNION query

2019-08-20 Thread Andres Freund
s libc-2.28.so [.] __memset_avx2_erms - 90.94% page_fault __memset_avx2_erms tuplehash_allocate tuplehash_create BuildTupleHashTableExt build_hash_table ExecInitAgg ExecInitNode InitPlan standard_ExecutorStart Greetings, Andres Freund

Re: PSQL performance - TPS

2019-08-01 Thread Andres Freund
t; That can matter quite a bit. Why aren't you surprised? I can easily get 20k+ write transactions/sec on my laptop, with synchronous_commit=off. With appropriate shared_buffers and other settings, the disk speed shouldn't matter that much for in insertion mostly workload. Greetings, Andres Freund

Re: PSQL performance - TPS

2019-08-01 Thread Andres Freund
that? Are your clients in the same datacenter as your database? Otherwise it could be that you're mostly seeing latency effects. Greetings, Andres Freund

Re: Perplexing, regular decline in performance

2019-07-18 Thread Andres Freund
( SELECT datname, pd.blks_read - ps.blks_read AS blks_read, pd.blks_hit - ps.blks_hit AS blks_hit FROM pg_stat_database pd JOIN pg_stat_database_snap ps USING (datname) ) pd_diff; Greetings, Andres Freund

Re: Perplexing, regular decline in performance

2019-07-17 Thread Andres Freund
Ivan Kartyshov, reviewed by Tomas Vondra and Robert Haas. Discusssion: so everything from 10 onwards ought to be fine. Greetings, Andres Freund

Re: GCC 8.3.0 vs. 9.0.1

2019-05-07 Thread Andres Freund
Hi, On 2019-05-07 10:32:45 -0700, Andres Freund wrote: > pgbench -i -q -s 96 && pgbench -n -c 8 -j 8 -T 100 -P1 possibly also worthwhile to note: Adding -M prepared (which I think phoronix doesn't specify) makes this considerably faster... Greetings, Andres Freund

Re: GCC 8.3.0 vs. 9.0.1

2019-05-07 Thread Andres Freund
as a whole, not just a single TU at a time. This enables > it to perform additional aggressive optimization. Note that the flags described don't enable LTO. Greetings, Andres Freund

Re: GCC 8.3.0 vs. 9.0.1

2019-05-07 Thread Andres Freund
t the data types we collect and what we use this for and > your related rights is set out in our online privacy policy at > https://www.gam.com/en/legal/privacy-policy. > Please familiarise yourself with this policy and check it from time to time > for updates as it supplements this notice. This is a public list. Greetings, Andres Freund

Re: Generic Plans for Prepared Statement are 158155 times slower than Custom Plans

2019-04-29 Thread Andres Freund
the custom plan leads to the generic plan to always be preferred. In particular for indexed queries, on system that set random_page_cost = seq_page_cost = 1 (due to SSD or expectation that workload is entirely cached), the added cost from cached_plan_cost() can be noticable in comparison to the estimated cost of the total query. Greetings, Andres Freund

Re: Commit(?) overhead

2019-04-09 Thread Andres Freund
t testing it with synchronous_commit=off instead. That's about as fast for this type of workload, doesn't have cluster corruption issues, the window of a transaction not persisting in case of a crash is very small, and it can just set by any user in individual sessions. Greetings, Andres Freund

Re: Planning performance problem (67626.278ms)

2019-04-08 Thread Andres Freund
initial_cost_mergejoin > try_mergejoin_path > add_paths_to_joinrel > make_join_rel > join_search_one_level > standard_join_search > make_one_rel > query_planner > ... I suspect some of this might be related to < 11 not having the following commit: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=3ca930fc39ccf987c1c22fd04a1e7463b5dd0dfd Greetings, Andres Freund

Re: Block / Page Size Optimization

2019-04-08 Thread Andres Freund
d 8KB postgres block size. There still might be some benefit of different FS block sizes, but it's not going to be related directly to IOPS. Greetings, Andres Freund

Re: JIT performance question

2019-03-06 Thread Andres Freund
Hi, On 2019-03-06 19:21:33 +0100, Tobias Gierke wrote: > On 06.03.19 18:42, Andres Freund wrote: > > > > It's hard to know precisely without running a profile of the > > workload. My suspicion is that the bottleneck in this query is the use > > of numeric, which

Re: JIT performance question

2019-03-06 Thread Andres Freund
n JITing aggregation. There's a lot of further improvements on the table with better JIT code generation, I just haven't gotten around implementing those :( Greetings, Andres Freund

Re: Performance regressions found using sqlfuzz

2019-02-15 Thread Andres Freund
e=74.799..74.799 rows=0 loops=1) > Filter: (SubPlan 1) > Rows Removed by Filter: 30044 > SubPlan 1 > -> Subquery Scan on subq_1 (cost=0.00..0.02 rows=1 width=0) (actual > time=0.002..0.002 rows=0 loops=30044) > -> HashAggregate (cost=0.00..0.01 rows=1 width=20) (actual > time=0.000..0.000 rows=0 loops=30044) > Group Key: ref_0.o_entry_d, c_credit > -> Result (cost=0.00..0.00 rows=0 width=20) (actual > time=0.000..0.000 rows=0 loops=30044) > One-Time Filter: false > Planning Time: 0.350 ms > Execution Time: 79.237 ms I think that might be fixed in the latest point release. I screwed up and made resets of tuple hash tables (and there's 30044 of those here) more expensive. It's fixed in the latest minor release however. Greetings, Andres Freund

Re: slow to run query 5000 times

2019-02-09 Thread Andres Freund
, so I appreciate self contained email. Greetings, Andres Freund

Re: JIT overhead slowdown

2019-01-18 Thread Andres Freund
u want to play around with it? Greetings, Andres Freund

Re: amazon aroura config - seriously overcommited defaults? (May be Off Topic)

2018-12-08 Thread Andres Freund
On 2018-12-08 15:23:19 -0800, Rob Sargent wrote: > > > > On Dec 8, 2018, at 3:12 PM, Andres Freund wrote: > > > > On 2018-12-08 12:06:23 -0800, Jeremy Schneider wrote: > >> On RDS PostgreSQL, the default is 25% of your server memory. This seems > >&

Re: Explain is slow with tables having many columns

2018-09-24 Thread Andres Freund
I thought it would also have been related to > https://www.postgresql.org/message-id/CAMkU%3D1xPqHP%3D7YPeChq6n1v_qd4WGf%2BZvtnR-b%2BgyzFqtJqMMQ%40mail.gmail.com Neither of these are related to the problem. Greetings, Andres Freund

Re: Explain is slow with tables having many columns

2018-09-24 Thread Andres Freund
called once for each column in a select list (or using or ...). IIRC we've hit this once when I was at citus, too. We really should be usign a more appropriate datastructure here - very likely a hashtable. Unfortunately such a change would likely be a bit too much to backpatch... Greetings,

Re: Bi-modal streaming replication throughput

2018-08-17 Thread Andres Freund
On 2018-08-17 15:21:19 +0200, Alexis Lê-Quôc wrote: > On Tue, Aug 14, 2018 at 7:50 PM Andres Freund wrote: > > > Hi, > > > > On 2018-08-14 10:46:45 -0700, Andres Freund wrote: > > > On 2018-08-14 15:18:55 +0200, Alexis Lê-Quôc wrote: > > >

Re: Calculating how much redo log space has been used

2018-08-14 Thread Andres Freund
will likely write the full page very often. Yes, my hands are > tied! Why is that a requirement / how is specifically phrased? Is it a bounded recovery time? Greetings, Andres Freund

Re: Bi-modal streaming replication throughput

2018-08-14 Thread Andres Freund
[k] > copy_user_enhanced_fast_string Possible that a slightly bigger shared buffer would help you. It'd probably more helpful to look at a perf report --no-children for this kind of analysis. Greetings, Andres Freund

Re: Performance difference in accessing differrent columns in a Postgres Table

2018-07-31 Thread Andres Freund
Hi, On 2018-07-31 12:56:26 -0400, Jeff Janes wrote: > On Mon, Jul 30, 2018 at 1:23 PM, Andres Freund wrote: > > > On 2018-07-30 07:19:07 -0400, Jeff Janes wrote: > > > > > And indeed, in my hands JIT makes it almost 3 times worse. > > > > Not in my measure

Re: Performance difference in accessing differrent columns in a Postgres Table

2018-07-30 Thread Andres Freund
time show up there? As my timings showed, I don't see the slowdown you're reporting. Could you post a few EXPLAIN ANALYZEs? Greetings, Andres Freund

Re: Performance difference in accessing differrent columns in a Postgres Table

2018-07-30 Thread Andres Freund
Hi, On 2018-07-30 18:01:34 +0200, Pavel Stehule wrote: > look on > http://www.postgresql-archive.org/PATCH-LLVM-tuple-deforming-improvements-td6029385.html > thread, please. Given the results I just posted in the sibling email I don't think those issues apply here. Greetings, Andres Freund

Re: Performance difference in accessing differrent columns in a Postgres Table

2018-07-30 Thread Andres Freund
n to a near optimal loop around the intermittent bigint columns (which we deform because we use a slot - at some point we're going to have to do better). No checks for the NULL bitmap, no alignment considerations, all that's optimized away. Greetings, Andres Freund

Re: Faster str to int conversion (was Table with large number of int columns, very slow COPY FROM)

2018-07-20 Thread Andres Freund
Hi, On 2018-07-20 08:27:34 -0400, Robert Haas wrote: > On Thu, Jul 19, 2018 at 4:32 PM, Andres Freund wrote: > >> 1. Why the error message changes? If there's a good reason, it should > >> be done as a separate commit, or at least well-documented in the > >> c

Re: Faster str to int conversion (was Table with large number of int columns, very slow COPY FROM)

2018-07-19 Thread Andres Freund
Hi, On 2018-07-18 14:34:34 -0400, Robert Haas wrote: > On Sat, Jul 7, 2018 at 4:01 PM, Andres Freund wrote: > > FWIW, here's a rebased version of this patch. Could probably be polished > > further. One might argue that we should do a bit more wide ranging > > changes

Re: Faster str to int conversion (was Table with large number of int columns, very slow COPY FROM)

2018-07-07 Thread Andres Freund
Hi, On 2017-12-08 13:44:37 -0800, Andres Freund wrote: > On 2017-12-08 10:17:34 -0800, Andres Freund wrote: > > the strtoll is libc functionality triggered by pg_atoi(), something I've > > seen show up in numerous profiles. I think it's probably time to have > > our

Re: Setting effective_io_concurrency in VM?

2017-11-27 Thread Andres Freund
s suggest that the sweet spot is more likely to be an order of magnitude or two bigger. Depends a bit on your workload (including size of scans and concurrency) obviously. Greetings, Andres Freund