Re: Any way to get nested loop index joins on CTEs?

2025-08-29 Thread Renan Alves Fonseca
Hi, it is definitively possible to get nested loop joins on successively aggregated CTEs. However, for the index to be used, it must exist. And you can only create the index on a real table, not on the intermediate CTEs. > WITH series1h AS MATERIALIZED (SELECT generate_series AS ts FROM > generat

Re: Very slow query performance when using CTE

2025-04-01 Thread Renan Alves Fonseca
Chris Joysn writes: > Hello, > I have an issue when using CTEs. A query, which consists of multiple CTEs, > runs usually rather fast (~5s on my > environment). But it turned out that using one CTE can lead to execution > times of up to one minute. > That CTE is used two times within the query.

Re: Bulk DML performance

2025-03-17 Thread Renan Alves Fonseca
Hi, Here are some observations. Em seg., 17 de mar. de 2025 às 09:19, escreveu: > > PostgreSQL has a lot of overhead per row. > > Okay, thanks. I'm not actually too worried about this since in my > scenario, each row is about 1.5 kB, so the % overhead is negligible. > > > It is probably not the

Re: Bulk DML performance

2025-03-13 Thread Renan Alves Fonseca
Hello, Regarding the additional time for UPDATE, you can try the following: CREATE TABLE test3 ( id bigint PRIMARY KEY, text1 text ) WITH (fillfactor=30); See: https://www.postgresql.org/docs/17/storage-hot.html My local test gives me almost the same time for INSERT (first insert) and UPDATES