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
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
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
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
p_combine(context, step_ids,
PARTPRUNE_COMBINE_INTERSECT);
result = lappend(result, step);
}
}
--
Best Regards
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
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
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
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
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
> > > "
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
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
a bit of
off-topics
or it has been discussed already.
--
Best Regards
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
40development#cf34e9db80326709af892ac64bc4cb45
[2]
https://www.postgresql.org/message-id/caku4awqujmqdu9qf_pxxbyetkixhtaxaq_qtx7wxelw27ph...@mail.gmail.com
--
Best Regards
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);
>
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.
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
he cc list.
--
Best Regards
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
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
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
ww.postgresql.org/message-id/CAApHDvry0nSV62kAOH3iccvfPhGPLN0Q97%2B%3Db1RsDPXDz3%3DCiQ%40mail.gmail.com
--
Best Regards
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
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
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
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
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
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
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
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
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
/message-id/CAN-LCVO3GZAKVTKNwwcezoc%3D9Lq%3DkU2via-BM3MXVdOq4tD9RQ%40mail.gmail.com
--
Best Regards
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_
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
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
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
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
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
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)
>
> ...
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
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
r than FirstNormalTransactionId looks strange as
well. IIUC, should we remove it to save a prediction on each
GetNewTransactionId call?
--
Best Regards
Andy Fan
om
[3]
https://www.postgresql.org/message-id/6718759c-2dac-48e4-bf18-282de4d82204%40enterprisedb.com
--
Best Regards
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
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"
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
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
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
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
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
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
--
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
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
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
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
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
#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
sting
excellent project I can start with and contribute to.
Thanks!
--
Best Regards
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
"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
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}
>
>
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
I will go to [0] for further dicussion on this topic.
> [0] https://postgr.es/m/20220408203003.GA1630183%40nathanxps13
--
Best Regards
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
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
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
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
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,
(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
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
>>&
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.
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
?
Thanks
--
Best Regards
Andy Fan
||
(scan_result == PSCAN_EOL && pset.singleline))
{
--
Best Regards
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
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
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
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
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
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
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
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
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
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(
/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
601 - 686 of 686 matches
Mail list logo