From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Alexander Korotkov <aekorotkov(at)gmail(dot)com> |
Cc: | Alexander Korotkov <akorotkov(at)postgresql(dot)org>, pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | Re: pgsql: Introduce hash_search_with_hash_value() function |
Date: | 2024-08-07 10:02:52 |
Message-ID: | CAFj8pRAXmv6eyYx=E_BTfyK=O_+yOF8sXB=0bn9eOBt90EgWRA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers pgsql-hackers |
st 7. 8. 2024 v 10:52 odesílatel Alexander Korotkov <aekorotkov(at)gmail(dot)com>
napsal:
> Hi, Pavel!
>
> On Wed, Aug 7, 2024 at 9:35 AM Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
> > st 7. 8. 2024 v 6:08 odesílatel Alexander Korotkov <
> akorotkov(at)postgresql(dot)org> napsal:
> >>
> >> Introduce hash_search_with_hash_value() function
> >>
> >> This new function iterates hash entries with given hash values. This
> function
> >> is designed to avoid full sequential hash search in the syscache
> invalidation
> >> callbacks.
> >>
> >> Discussion:
> https://postgr.es/m/5812a6e5-68ae-4d84-9d85-b443176966a1%40sigaev.ru
> >> Author: Teodor Sigaev
> >> Reviewed-by: Aleksander Alekseev, Tom Lane, Michael Paquier, Roman
> Zharkov
> >> Reviewed-by: Andrei Lepikhov
> >
> >
> > I tried to use hash_seq_init_with_hash_value in session variables patch,
> but it doesn't work there.
> >
> > <-->if (!sessionvars)
> > <--><-->return;
> >
> > elog(NOTICE, "%u", hashvalue);
> >
> >
> > <-->hash_seq_init(&status, sessionvars);
> >
> > <-->while ((svar = (SVariable) hash_seq_search(&status)) != NULL)
> > <-->{
> > <--><-->if (hashvalue == 0 || svar->hashvalue == hashvalue)
> > <--><-->{
> > <--><--><-->elog(NOTICE, "FOUND OLD");
> > <--><--><-->svar->is_valid = false;
> > <--><-->}
> > <-->}
> >
> >
> >
> > <-->/*
> > <--> * If the hashvalue is not specified, we have to recheck all
> currently
> > <--> * used session variables. Since we can't tell the exact session
> variable
> > <--> * from its hashvalue, we have to iterate over all items in the hash
> bucket.
> > <--> */
> > <-->if (hashvalue == 0)
> > <--><-->hash_seq_init(&status, sessionvars);
> > <-->else
> > <--><-->hash_seq_init_with_hash_value(&status, sessionvars, hashvalue);
> >
> > <-->while ((svar = (SVariable) hash_seq_search(&status)) != NULL)
> > <-->{
> > <--><-->Assert(hashvalue == 0 || svar->hashvalue == hashvalue);
> >
> > elog(NOTICE, "found");
> >
> > <--><-->svar->is_valid = false;
> > <--><-->needs_validation = true;
> > <-->}
> > }
> >
> > Old methods found an entry, but new not.
> >
> > What am I doing wrong?
>
> I'm trying to check this. Applying this patch [1], but got conflicts.
> Could you please, rebase the patch, so I can recheck the issue?
>
>
I sent rebased patchset
Message-ID:
CAFj8pRAskimJmB9Q8pHDa8YoLphVoZMH1xPeGBK8Eze=u+_hBQ(at)mail(dot)gmail(dot)com
<https://www.postgresql.org/message-id/CAFj8pRAskimJmB9Q8pHDa8YoLphVoZMH1xPeGBK8Eze%3Du%2B_hBQ%40mail.gmail.com>
Regards
Pavel
> Links.
> 1.
> https://www.postgresql.org/message-id/flat/CAFj8pRD053CY_N4%3D6SvPe7ke6xPbh%3DK50LUAOwjC3jm8Me9Obg%40mail.gmail.com
>
> ------
> Regards,
> Alexander Korotkov
> Supabase
>
From | Date | Subject | |
---|---|---|---|
Next Message | Alexander Korotkov | 2024-08-07 10:22:13 | Re: pgsql: Introduce hash_search_with_hash_value() function |
Previous Message | Peter Eisentraut | 2024-08-07 09:07:13 | Re: pgsql: Fix more holes with SLRU code in need of int64 for segment numbe |
From | Date | Subject | |
---|---|---|---|
Next Message | Aleksander Alekseev | 2024-08-07 10:19:19 | Re: [PATCH] Add crc32(text) & crc32(bytea) |
Previous Message | Amit Kapila | 2024-08-07 10:02:08 | Re: Found issues related with logical replication and 2PC |