Re: [HACKERS] Runtime Partition Pruning

2020-10-07 Thread Andy Fan
On Sun, Oct 4, 2020 at 3:10 PM Andy Fan wrote: > >> >> Now, in my experience, the current system for custom plans vs. generic >> plans doesn't approach the problem in this way at all, and in my >> experience that results in some pretty terrible behavior. It will

Re: Improve choose_custom_plan for initial partition prune case

2020-10-07 Thread Andy Fan
Thank you Amit and Ashutosh for your reply! On Wed, Oct 7, 2020 at 8:41 PM Amit Langote wrote: > Hi Ashutosh, > > On Wed, Oct 7, 2020 at 8:40 PM Ashutosh Bapat > wrote: > > On Wed, Oct 7, 2020 at 11:20 AM Andy Fan > wrote: > > > On Mon, Oct 5, 2020 at 9:27 PM Ash

Re: [HACKERS] Runtime Partition Pruning

2020-10-07 Thread Andy Fan
On Wed, Oct 7, 2020 at 5:05 PM Andy Fan wrote: > > > On Sun, Oct 4, 2020 at 3:10 PM Andy Fan wrote: > >> >>> >>> Now, in my experience, the current system for custom plans vs. generic >>> plans doesn't approach the problem in this way at all, an

Re: [PATCH] Keeps tracking the uniqueness with UniqueKey

2020-10-07 Thread Andy Fan
On Wed, Oct 7, 2020 at 9:55 PM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > On Wed, Sep 09, 2020 at 07:51:12AM +0800, Andy Fan wrote: > > > > Thank you Michael for checking it, I can reproduce the same locally after > > rebasing to the latest master. The attached

Wired if-statement in gen_partprune_steps_internal

2020-10-08 Thread Andy Fan
p_combine(context, step_ids, PARTPRUNE_COMBINE_INTERSECT); result = lappend(result, step); } } -- Best Regards Andy Fan

Re: [HACKERS] Runtime Partition Pruning

2020-10-11 Thread Andy Fan
Hi Ashutosh: On Thu, Oct 8, 2020 at 7:25 PM Ashutosh Bapat wrote: > On Wed, Oct 7, 2020 at 7:00 PM Andy Fan wrote: > > > > > > > > On Wed, Oct 7, 2020 at 5:05 PM Andy Fan > wrote: > >> > >> > >> > >> On Sun, Oct 4, 2020 at

Re: [PATCH] Keeps tracking the uniqueness with UniqueKey

2020-10-11 Thread Andy Fan
List*exprs = NIL; > ... > + foreach(lc, unionrel->reltarget->exprs) > + { > + exprs = lappend(exprs, lfirst(lc)); > + } > > Best regards, > > > Thank you zhijie, I will fix them in next version. -- Best Regards Andy Fan

Re: [PATCH] Keeps tracking the uniqueness with UniqueKey

2020-10-11 Thread Andy Fan
On Thu, Oct 8, 2020 at 6:39 PM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > On Thu, Oct 08, 2020 at 09:34:51AM +0800, Andy Fan wrote: > > > > > Other than that I wanted to ask what are the plans to proceed with this > > > patch? It's been a while sinc

Re: [HACKERS] Runtime Partition Pruning

2020-10-12 Thread Andy Fan
On Mon, Oct 12, 2020 at 5:48 PM Ashutosh Bapat wrote: > On Mon, Oct 12, 2020 at 7:59 AM Andy Fan wrote: > > > > > Sorry for the late reply! Suppose we have partition defined like this: > > p > > - p1 > > - p2 > > > > When you talk about &qu

Re: [HACKERS] Runtime Partition Pruning

2020-10-13 Thread Andy Fan
On Tue, Oct 13, 2020 at 3:48 PM Amit Langote wrote: > On Thu, Oct 8, 2020 at 8:25 PM Ashutosh Bapat > wrote: > > On Wed, Oct 7, 2020 at 7:00 PM Andy Fan > wrote: > > > I can understand Robert's idea now, he intended to resolve both the > > > "

Re: Wired if-statement in gen_partprune_steps_internal

2020-10-13 Thread Andy Fan
On Mon, Oct 12, 2020 at 4:37 PM Amit Langote wrote: > Hi, > > On Thu, Oct 8, 2020 at 6:56 PM Andy Fan wrote: > > > > Hi: > > > > I found the following code in gen_partprune_steps_internal, which > > looks the if-statement to be always true since l

RelationGetNumberOfBlocks is called every time of heap_rescan.

2020-10-14 Thread Andy Fan
wever I see the code checks the number of blocks at every rescan regardless of snapshot type which I can't understand. This behavior doesn't cause any troubles to me (I may care about this for Index Scan, but looks IndexScan doesn't need to do that), So I am asking just for education purposes. Thanks! -- Best Regards Andy Fan

Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY

2020-10-14 Thread Andy Fan
a bit of off-topics or it has been discussed already. -- Best Regards Andy Fan

Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY

2020-10-14 Thread Andy Fan
Hi David/Alvaro: On Thu, Oct 15, 2020 at 9:09 AM David Rowley wrote: > On Thu, 15 Oct 2020 at 14:04, Andy Fan wrote: > > > > I think if it is possible to implement the detech with a NoWait option . > > > > ALTER TABLE ... DETACH PARTITION .. [NoWait]. > > &g

improve the algorithm cached_plan_cost with real planning time?

2020-10-15 Thread Andy Fan
40development#cf34e9db80326709af892ac64bc4cb45 [2] https://www.postgresql.org/message-id/caku4awqujmqdu9qf_pxxbyetkixhtaxaq_qtx7wxelw27ph...@mail.gmail.com -- Best Regards Andy Fan

Re: improve the algorithm cached_plan_cost with real planning time?

2020-10-15 Thread Andy Fan
On Thu, Oct 15, 2020 at 9:12 PM Andy Fan wrote: > > In cached_plan_cost, we do consider the cost of planning, with the > following > algorithm. > > int nrelations = list_length(plannedstmt->rtable); > > result += 1000.0 * cpu_operator_cost * (nrelations + 1); >

Re: Partition prune with stable Expr

2020-10-15 Thread Andy Fan
On Mon, Sep 28, 2020 at 8:21 PM Andy Fan wrote: > > > On Mon, Sep 28, 2020 at 7:15 AM Tom Lane wrote: > >> Andy Fan writes: >> > On Mon, Sep 28, 2020 at 4:46 AM David Rowley >> wrote: >> >> Thanks for showing an interest in partition pruning.

Re: Wired if-statement in gen_partprune_steps_internal

2020-10-20 Thread Andy Fan
On Wed, Oct 14, 2020 at 11:26 AM Andy Fan wrote: > > > On Mon, Oct 12, 2020 at 4:37 PM Amit Langote > wrote: > >> Hi, >> >> On Thu, Oct 8, 2020 at 6:56 PM Andy Fan wrote: >> > >> > Hi: >> > >> > I found the following code i

Would it be helpful for share the patch merge result from cfbot

2020-10-22 Thread Andy Fan
he cc list. -- Best Regards Andy Fan

Re: Would it be helpful for share the patch merge result from cfbot

2020-10-22 Thread Andy Fan
On Fri, Oct 23, 2020 at 9:58 AM Thomas Munro wrote: > On Fri, Oct 23, 2020 at 2:51 PM Thomas Munro > wrote: > > On Fri, Oct 23, 2020 at 2:32 PM Andy Fan > wrote: > > > Currently when people want to review a patch, they have to download / > apply / > > > mai

Re: GetRelationPath() vs critical sections

2024-10-05 Thread Andy Fan
just realize I proposed to [change] the API rather than adding an new variant, that's not my intention and that's my fault). -- Best Regards Andy Fan

Re: New function normal_rand_array function to contrib/tablefunc.

2024-10-16 Thread Andy Fan
a Datum. Done. > > > 13). These new functions are significantly under-documented, > especially when compared to all the other functions on > https://www.postgresql.org/docs/current/tablefunc.html > > They really should have their own subsection, along the same lines as &g

Re: Considering fractional paths in Append node

2024-10-18 Thread Andy Fan
ww.postgresql.org/message-id/CAApHDvry0nSV62kAOH3iccvfPhGPLN0Q97%2B%3Db1RsDPXDz3%3DCiQ%40mail.gmail.com -- Best Regards Andy Fan

Re: MergeAppend could consider sorting cheapest child path

2024-10-16 Thread Andy Fan
ult, the leader just do the merge works. At the high level implementaion, sorting *cheapest* child path looks doesn't add too much overhead on the planning effort. -- Best Regards Andy Fan

Re: Considering fractional paths in Append node

2024-10-16 Thread Andy Fan
rel since root->tuple_fraction is on subquery level, while the add_paths_to_append_rel is only on RelOptInfo level. [1] https://www.postgresql.org/message-id/CAApHDvry0nSV62kAOH3iccvfPhGPLN0Q97%2B%3Db1RsDPXDz3%3DCiQ%40mail.gmail.com -- Best Regards Andy Fan

Re: Considering fractional paths in Append node

2024-10-17 Thread Andy Fan
ate_orderedappend_paths() when we have a valid LIMIT value. > I'm currently checking if it is working correctly in multiple cases, > so 'll send it after we deal with this issue. -- Best Regards Andy Fan

Re: Considering fractional paths in Append node

2024-10-17 Thread Andy Fan
enk1 t1 (cost=0.29..80.09 rows=1 width=8) Index Cond: (tenthous = t2.tenthous) -> Result (cost=0.00..0.01 rows=1 width=4) (8 rows) Looks we still have some other stuff to do, but we have seen the desired plan has a closer cost to estimated best plan than before. [1] https://www.postgresql.org/message-id/flat/3783591.1721327902%40sss.pgh.pa.us#09d6471fc59b35fa4aca939e49943c2c -- Best Regards Andy Fan

Re: detoast datum into the given buffer as a optimization.

2024-10-28 Thread Andy Fan
Hi Tom, > Andy Fan writes: >> * Note if caller provides a non-NULL buffer, it is the duty of caller >> * to make sure it has enough room for the detoasted format (Usually >> * they can use toast_raw_datum_size to get the size) > > This is a pretty awful, unsaf

Re: Considering fractional paths in Append node

2024-10-28 Thread Andy Fan
as RelOptInfo's tuple_fraction. (b). We have used root->tuple_fraction in RelOptInfo in some cases and also tried to not use it in some other case (and only use it under some situation similar like what I did before). Looks different committers have different opinion on this. -- Best Regards Andy Fan

Re: detoast datum into the given buffer as a optimization.

2024-10-29 Thread Andy Fan
detoast, but then there is no detailed design or code later, which makes me confused about the state of this direction. But if you want to talk about this, could we discuss on its own thread? Thanks -- Best Regards Andy Fan

Re: [PoC] Partition path cache

2024-10-24 Thread Andy Fan
e first partition?". If I were you, I might check all the used statistics on this stage and try to find out a similar algorithms to prove that the best path would be similar too. This can happens once when the statistics is gathered. However this might be not easy. -- Best Regards Andy Fan

Re: detoast datum into the given buffer as a optimization.

2024-10-29 Thread Andy Fan
can check [1] for a indepent improvements for this topic. [1] https://www.postgresql.org/message-id/874j4vcspl.fsf%40163.com -- Best Regards Andy Fan

Re: Avoid detoast overhead when possible

2024-10-29 Thread Andy Fan
/message-id/CAN-LCVO3GZAKVTKNwwcezoc%3D9Lq%3DkU2via-BM3MXVdOq4tD9RQ%40mail.gmail.com -- Best Regards Andy Fan

Re: detoast datum into the given buffer as a optimization.

2024-10-28 Thread Andy Fan
ld' passed. -- Best Regards Andy Fan >From 7208142241ac18e44be2ee87e9c83c451032ca95 Mon Sep 17 00:00:00 2001 From: Andy Fan Date: Tue, 29 Oct 2024 14:05:05 +0800 Subject: [PATCH v20241029 1/1] Using more specific code when detoasting an expanded datum. In the detoast_attr function, VARATT_

Re: New function normal_rand_array function to contrib/tablefunc.

2024-11-03 Thread Andy Fan
Dean Rasheed writes: > On Wed, 16 Oct 2024 at 08:43, Andy Fan wrote: >> >> Thanks for the detailed feedback! Here is the rebased version. >> > > I took another look at this and I think it's in reasonable shape. > > I'm attaching an update, rebasi

Re: Avoid detoast overhead when possible

2024-10-30 Thread Andy Fan
t doesn't seem worthy at first glance. Do you have any ideas on > this? I think the more important ones are (a) what the new storage looks like, (b) how does it works with the ExprExecutionEnginner. Without that infromation, I think it is too soon to talk about this. -- Best Regards Andy Fan

Re: New function normal_rand_array function to contrib/tablefunc.

2024-10-26 Thread Andy Fan
Dean Rasheed writes: > On Sat, 26 Oct 2024 at 01:51, Andy Fan wrote: >> >> > 10). In this error: >> > >> > +elog(ERROR, "unsupported type %d for rand_array function.", >> > + datatype); >> > >> > &q

Re: explain plans for foreign servers

2024-11-11 Thread Andy Fan
oduce a new > message type in the protocol to send back explain plans but it might > look like too much work for this feature. Open to ideas here. This generally looks good to me. Looking forward a patch for the details. -- Best Regards Andy Fan

Re: -Wformat-signedness

2024-10-26 Thread Andy Fan
o, just that want some clean code:) But FWIW, "-Wformat-signedness" is not supported by clang so far, so if people is using clang, they still can't benefit from this changes. My soluation (I use clang everyday) is adding a "gcc-checker" for my c file, if I make such mistake, it can remind me directly. [0] https://www.postgresql.org/message-id/874j4yl4cj.fsf%40163.com [1] https://www.postgresql.org/message-id/CA%2BhUKGJNUk434tcsVbs5YUGsujZbveo43QcZeWbv0xPzg9us-A%40mail.gmail.com -- Best Regards Andy Fan

Re: detoast datum into the given buffer as a optimization.

2024-09-18 Thread Andy Fan
Thank you all for the double check. > Andy Fan writes: >> * Note if caller provides a non-NULL buffer, it is the duty of caller >> * to make sure it has enough room for the detoasted format (Usually >> * they can use toast_raw_datum_size to get the size) > > ...

Re: detoast datum into the given buffer as a optimization.

2024-09-18 Thread Andy Fan
Jubilee Young writes: > On Wed, Sep 18, 2024 at 2:23 PM Nathan Bossart > wrote: >> >> On Wed, Sep 18, 2024 at 05:35:56PM +0800, Andy Fan wrote: >> > Currently detoast_attr always detoast the data into a palloc-ed memory >> > and then if user wants the deto

Re: FullTransactionIdAdvance question

2024-09-22 Thread Andy Fan
Hi Andres: > On 2024-09-20 17:38:40 +0800, Andy Fan wrote: >> static inline void >> FullTransactionIdAdvance(FullTransactionId *dest) >> { .. >> } >> >> I understand this functiona as: 'dest->value++' increases the epoch when >> necessar

FullTransactionIdAdvance question

2024-09-20 Thread Andy Fan
r than FirstNormalTransactionId looks strange as well. IIUC, should we remove it to save a prediction on each GetNewTransactionId call? -- Best Regards Andy Fan

detoast datum into the given buffer as a optimization.

2024-09-18 Thread Andy Fan
om [3] https://www.postgresql.org/message-id/6718759c-2dac-48e4-bf18-282de4d82204%40enterprisedb.com -- Best Regards Andy Fan

Re: New function normal_rand_array function to contrib/tablefunc.

2024-11-06 Thread Andy Fan
Aleksander, I can understand your kindly intention! If no new ideas, I will defer to Dean's final decision for efficient purpose. -- Best Regards Andy Fan

Re: Deleting older versions in unique indexes to avoid page splits

2024-11-07 Thread Andy Fan
Peter Geoghegan writes: Hi Peter, I think I understand the main idea now with your help, I'd like to repeat my understanding for your double check. > On Thu, Nov 7, 2024 at 3:05 AM Andy Fan wrote: >> So my questions are: (a) How does the "logically unchanged index"

Re: New function normal_rand_array function to contrib/tablefunc.

2024-10-25 Thread Andy Fan
t any warnings. clang -O0 -g main.c -o main -Wall -Wformat gcc -g main.c -o main -Wall -Wformat scan-build clang -g main.c -o main -Wall -Wformat cppcheck main.c clang: 18.1.6 gcc: 13.3.0 Only "cppcheck --enable=all main.c" catch the warnning. Any hints on this will be appreicated. -- Best Regards Andy Fan

Re: Deleting older versions in unique indexes to avoid page splits

2024-11-07 Thread Andy Fan
split?), then the IO-cost is paid anyway, do we still need the "logically unchanged index hint"? At last, appreciated for your effort on making this part much better! -- Best Regards Andy Fan

Re: Deleting older versions in unique indexes to avoid page splits

2024-11-07 Thread Andy Fan
Peter Geoghegan writes: > On Thu, Nov 7, 2024 at 7:38 PM Andy Fan wrote: >> If the delete goes with Index Scan of t_b_idx, we still have the chances >> to mark hints on t_b_idx, so that it can be useful during index split? > > The exact rules for when LP_DEAD bits are set

Re: Deleting older versions in unique indexes to avoid page splits

2024-11-07 Thread Andy Fan
Andy Fan writes: > (3). DELETE does generate new index entry, but we might not touch > the indexes at all during deletes (*except the index we used for index > scan*). I still not check the code right now (it may still take times for me even I understand the overall design). So do w

Re: Code cleanup for detoast a expanded datum.

2024-11-18 Thread Andy Fan
Andy Fan writes: > > make check-world passed after applying this patch. v2 changes the places of Assert, which is missed in v1 by mistakes. -- Best Regards Andy Fan >From 0bbd242e034b8461e40bb17aec4fa354f5c97815 Mon Sep 17 00:00:00 2001 From: Andy Fan Date: Tue, 29 Oct 2024 14:05

Code cleanup for detoast a expanded datum.

2024-11-18 Thread Andy Fan
se a more specific code to handle this, see the attached patch. We already have lots of kind of toast type and some of checks have overlap, this cleanup should make people less confused when reading this code. make check-world passed after applying this patch. Any thought? -- Best Regards Andy

Document for wal_log_hints

2024-11-18 Thread Andy Fan
-- Best Regards Andy Fan >From f9925545a752475fce61caea942a0057106636e4 Mon Sep 17 00:00:00 2001 From: Andy Fan Date: Tue, 19 Nov 2024 08:58:22 +0800 Subject: [PATCH v1 1/1] doc: correct the method to test the impact of wal_log_hints. --- doc/src/sgml/config.sgml | 2 +- 1 file changed

Re: Document for wal_log_hints

2024-11-18 Thread Andy Fan
Michael Paquier writes: > On Tue, Nov 19, 2024 at 09:03:57AM +0800, Andy Fan wrote: >> So if data checksums is enabled, nothing can be tested when turning >> wal_log_hints on/off. >> @@ -3319,7 +3319,7 @@ include_dir 'conf.d' >> If data checksums are

Re: Extract numeric filed in JSONB more effectively

2024-11-17 Thread Andy Fan
Hi Dmitry, >> On Thu, Sep 12, 2024 at 03:03:18AM GMT, Andy Fan wrote: >> >> > I imagined you'd the patch should create a SupportRequestSimplify >> > support function for jsonb_numeric() that checks if the input >> > expression is an OpExpr with func

Re: Code cleanup for detoast a expanded datum.

2024-12-01 Thread Andy Fan
Michel Pelletier writes: > On Mon, Nov 18, 2024 at 7:42 PM Andy Fan wrote: > > Andy Fan writes: > > > > > make check-world passed after applying this patch. > > v2 changes the places of Assert, which is missed in v1 by mistakes. > > I'm not an ex

Re: postgres_fdw: Provide better emulation of READ COMMITTED behavior

2024-12-07 Thread Andy Fan
Etsuro Fujita writes: > On Fri, Dec 6, 2024 at 7:50 PM Andy Fan wrote: >> Apart from the above issue, what do you think about that we are using a >> 'SELECT pg_catalog.pg_refresh_snapshot()' to let the remote do the >> refresh_snapshot VS 'a new messag

Re: postgres_fdw: Provide better emulation of READ COMMITTED behavior

2024-12-06 Thread Andy Fan
#x27;a complete parser-planner-executor workflow.' With a new message type for this, we can send the message character with the next query together. if so, can the two overheads removed? -- Best Regards Andy Fan

testing framework for MVCC & vacuum (freeze) & heap_page_prune etc.

2024-12-09 Thread Andy Fan
sting excellent project I can start with and contribute to. Thanks! -- Best Regards Andy Fan

Re: testing framework for MVCC & vacuum (freeze) & heap_page_prune etc.

2024-12-09 Thread Andy Fan
Andy Fan writes: > Hi, > > I'm willing to design one myself > but it would be better have a ask first to see if there is some existing > excellent project I can start with and contribute to. Just to show that I'm not a person who taking things for granted, this is

Re: testing framework for MVCC & vacuum (freeze) & heap_page_prune etc.

2024-12-09 Thread Andy Fan
"Andrey M. Borodin" writes: >> On 10 Dec 2024, at 08:31, Andy Fan wrote: >> >> I want to know if we have some existing testing framework for >> this area (design, code, licence etc). > > I think isolation tests [0] are what you are looking for. These

Re: pgbench error: (setshell) of script 0; execution of meta-command failed

2025-01-09 Thread Andy Fan
Andy Fan writes: > Hi: > > I run into the {subject} issue with the below setup. > > cat foo.sql > > \setshell txn_mode echo ${TXN_MODE} > \setshell speed echo ${SPEED} > \setshell sleep_ms echo ${SLEEP_MS} > \setshell subtxn_mode echo ${SUBTXN_MODE} > >

pgbench error: (setshell) of script 0; execution of meta-command failed

2025-01-09 Thread Andy Fan
find anything useful, so I'd like have a ask if there is any known issue or the way I use \setshell is wrong? Thanks -- Best Regards Andy Fan

Re: Purpose of wal_init_zero

2025-01-20 Thread Andy Fan
I will go to [0] for further dicussion on this topic. > [0] https://postgr.es/m/20220408203003.GA1630183%40nathanxps13 -- Best Regards Andy Fan

Re: Pre-allocating WAL files

2025-01-20 Thread Andy Fan
ocated yet. - we need to handle race condition carefully between wal_recycle, user backend and preallocation. [0] https://www.postgresql.org/message-id/Z46BwCNAEjLyW85Z%40nathan -- Best Regards Andy Fan

Re: Pre-allocating WAL files

2025-01-21 Thread Andy Fan
s me user can only fsync one file each time. int fsync(int fd); The fsync manual seems not saying fsync on a directory would fsync all the files under that directory. -- Best Regards Andy Fan

Purpose of wal_init_zero

2025-01-15 Thread Andy Fan
still unclear to me. I noticed this during a benchmark, where WALWriteLock is waited and the holder is running WAIT_EVENT_WAL_INIT_WRITE. -- Best Regards Andy Fan

Re: Purpose of wal_init_zero

2025-01-15 Thread Andy Fan
have a try if we can offload wal_init_zero to the walwriter. About the wal_recycle, IIUC, it can only recycle a wal file during Checkpoint, but checkpoint doesn't happens often. -- Best Regards Andy Fan

Re: a pool for parallel worker

2025-03-24 Thread Andy Fan
Hi, > On Tue, Mar 11, 2025 at 5:39 AM Andy Fan wrote: >> Currently when a query needs some parallel workers, postmaster spawns >> some backend for this query and when the work is done, the backend >> exit. there are some wastage here, e.g. syscache, relcache, smgr cache,

Re: a pool for parallel worker

2025-03-25 Thread Andy Fan
(b). Is there any other ways to allow different user with the same database sharing the same connection? Current "SET ROLE x" is exciting but "RESET SESSION AUTHORIZATION" is dispointing. -- Best Regards Andy Fan

Re: a pool for parallel worker

2025-03-25 Thread Andy Fan
Andy Fan writes: > Hi, >>> The boring thing for the pool is it is [dbid + userId] based, which >>> I mean if the dbid or userId is different with the connection in pool, >>> they can't be reused. To reduce the effect of UserId, I think if we can >>&

Re: Why does exec_simple_query requires 2 snapshots

2025-02-18 Thread Andy Fan
Tom Lane writes: > Andy Fan writes: >> My question is why can't we share the same snapshot for the 2 cases? >> parser & planner requires Catalog Snapshot which should be the >> latest one, but in the above case, looks the executor can reuse it as >> well.

Re: Why does exec_simple_query requires 2 snapshots

2025-02-19 Thread Andy Fan
Tom Lane writes: > Andy Fan writes: >> Tom Lane writes: >>> Many years ago, we committed a patch to do exactly that. We had >>> to back it out again because it broke too many real-world scenarios. >>> I'm too lazy to search the archives for you, but

Why does exec_simple_query requires 2 snapshots

2025-02-18 Thread Andy Fan
? Thanks -- Best Regards Andy Fan

Send multiple statements to pg server at once

2025-03-11 Thread Andy Fan
|| (scan_result == PSCAN_EOL && pset.singleline)) { -- Best Regards Andy Fan

Re: Send multiple statements to pg server at once

2025-03-11 Thread Andy Fan
Pavel Stehule writes: > > If I remember well, you can use \; for this case > > https://www.postgresql.org/docs/current/app-psql.html > > Regards Thank you Pavel, it works! This is so handy! -- Best Regards Andy Fan

a pool for parallel worker

2025-03-11 Thread Andy Fan
connection in pool, they can't be reused. To reduce the effect of UserId, I think if we can start the pool with a superuser and then switch the user information with 'SET ROLE xxx'. and the pool can be created lazily. Any comments on this idea? -- Best Regards Andy Fan

Re: Bypassing cursors in postgres_fdw to enable parallel plans

2025-03-12 Thread Andy Fan
gt;already_executed || numberTuples != 0) use_parallel_mode = false; Actually I can't understand the comment as well and I had this confusion for a long time. -- Best Regards Andy Fan

parallel_safe

2025-05-20 Thread Andy Fan
ing the different parallel_safe would make parallel works in some more places? Do you think the benefits would be beyond the SubPlan one (I can't make a example beside SubPlan so far). -- Best Regards Andy Fan

Re: Pathify RHS unique-ification for semijoin planning

2025-05-22 Thread Andy Fan
join from "rel1" and "rel2" using > JOIN_UNIQUE_OUTER or JOIN_UNIQUE_INNER to a join between "rel1" and > "rel2_unique" using a standard JOIN_INNER, we might be able to get > rid of the JOIN_UNIQUE_OUTER and JOIN_UNIQUE_INNER jointypes. if we can, +10. -- Best Regards Andy Fan

Re: Feature Suggestion: Make synchronous_commit a table level property

2025-05-22 Thread Andy Fan
e, so only a transaction which touch the derived table *only* could get benefit from this feature. As an alternative, your application could identify the "derived table only" transaction and set synchronous_commit to off by your own. -- Best Regards Andy Fan

Re: plan shape work

2025-05-22 Thread Andy Fan
Andy Fan writes: > >> This list of elided nodes is stored in the PlannedStmt > > I did a quick check on the attached patches and I can see some more > information is added into PlannedStmt. then my question are the > PlannedStmt is not avaiable during the future planning c

Re: Expression push down from Join Node to below node.

2025-05-22 Thread Andy Fan
ort at [1], but Robert thought it was unaccptable, then the project is dead. Your case makes me think about it again. [1] https://www.postgresql.org/message-id/CA%2BTgmoZfpruG%3DVvqeKLiRC95VbbxEyxBm8d1r3YOpaedkQuL4A%40mail.gmail.com -- Best Regards Andy Fan

Re: plan shape work

2025-05-21 Thread Andy Fan
gt; that code that is doing plan tree inspection can look at it but > execution doesn't get any slower. Thank you for sharing this! -- Best Regards Andy Fan

Re: parallel_safe

2025-05-22 Thread Andy Fan
Andy Fan writes: Hi, Some clearer idea are provided below. Any feedback which could tell this is *obviously wrong* or *not obviously wrong* is welcome. > see the below example: > > create table bigt (a int, b int, c int); > insert into bigt select i, i, i from generate_series(

Re: Expression push down from Join Node to below node.

2025-05-29 Thread Andy Fan
/approach to check or should we do changes while parsing in > deconstruct_jointree(), in distiribute_quals_to_rels we > can update the appropriate baserestrictinfo. > Pls share your thoughts on the same. Hash Cond invovles two sides of the relations, how could we push down it under one side of it? I can't follow up on this well, have you a draft plan / code for your idea? -- Best Regards Andy Fan

<    2   3   4   5   6   7