How to declare GIN index on array type column when bootstrap?

2024-05-21 Thread Zhang Mingli
in catalog when bootstrap? Thanks. Zhang Mingli www.hashdata.xyz

Re: weird GROUPING SETS and ORDER BY behaviour

2024-01-06 Thread Zhang Mingli
Hi, Zhang Mingli www.hashdata.xyz On Jan 6, 2024 at 23:38 +0800, Geoff Winkless , wrote: > > I was hoping to see > > gp_n | gp_conc | n | concat > --+-+--+ > 1 | 0 | NULL | n1x5 > 1 | 0 | NULL | n2x4 > 1 | 0 | NULL | n3x3 > 1 | 0 | NULL | n4x

Re: weird GROUPING SETS and ORDER BY behaviour

2024-01-05 Thread Zhang Mingli
Hi, Zhang Mingli www.hashdata.xyz On Jan 6, 2024 at 01:38 +0800, Geoff Winkless , wrote: > > Am I missing some reason why the first set isn't sorted as I'd hoped? Woo, it’s a complex order by, I try to understand your example. And I think the order is right, what’s your expected order

Re: Minor cleanup for search path cache

2024-01-01 Thread Zhang Mingli
Hi, Zhang Mingli www.hashdata.xyz On Jan 2, 2024 at 05:38 +0800, Tom Lane , wrote: > I happened to notice that there is a not-quite-theoretical crash > hazard in spcache_init(). If we see that SPCACHE_RESET_THRESHOLD > is exceeded and decide to reset the cache, but then nsphash_creat

Re: Why do parallel scans require syncscans (but not really)?

2023-12-30 Thread Zhang Mingli
Hi, Zhang Mingli www.hashdata.xyz Hi, Tomas On Dec 31, 2023 at 07:10 +0800, Tomas Vondra , wrote: > Sadly, there's no explanation why parallel scans do not allow disabling > sync scans just like serial scans - and it's not quite obvious to me. Feel confused too. ```

Remove useless GROUP BY columns considering unique index

2023-12-29 Thread Zhang Mingli
/CAApHDvrdYa%3DVhOoMe4ZZjZ-G4ALnD-xuAeUNCRTL%2BPYMVN8OnQ%40mail.gmail.com Zhang Mingli www.hashdata.xyz v1-0001-Remove-useless-GROUP-BY-columns-considering-unique-i.patch Description: Binary data

Re: introduce dynamic shared memory registry

2023-12-20 Thread Zhang Mingli
Hi, all I see most xxxShmemInit functions have the logic to handle IsUnderPostmaster env. Do we need to consider it in DSMRegistryShmemInit() too? For example, add some assertions. Others LGTM. Zhang Mingli www.hashdata.xyz On Dec 5, 2023 at 11:47 +0800, Nathan Bossart , wrote: > Every o

Re: Simplify newNode()

2023-12-13 Thread Zhang Mingli
Hi, LGTM. + Assert(size >= sizeof(Node)); /* need the tag, at least */ + result = (Node *) palloc0fast(size); + result->type = tag; + return result; +} How about moving the comments /* need the tag, at least */ after result->type = tag; by the way? Zha

useless LIMIT_OPTION_DEFAULT

2023-12-13 Thread Zhang Mingli
default limit enum. I remove it and have an install check to verify. Are there any considerations behind this? Shall we remove it for clear as it’s not actually the default option. Zhang Mingli www.hashdata.xyz v1-0001-Remove-useless-LIMIT_OPTION_DEFAULT.patch Description: Binary data

Re: COPY TO (FREEZE)?

2023-10-30 Thread Zhang Mingli
HI, Zhang Mingli www.hashdata.xyz On Oct 31, 2023 at 03:55 +0800, Bruce Momjian , wrote: > > Sure, updated patch attached. LGTM.

Re: COPY TO (FREEZE)?

2023-10-29 Thread Zhang Mingli
HI, Zhang Mingli www.hashdata.xyz On Oct 30, 2023 at 10:58 +0800, Bruce Momjian , wrote: > On Mon, Oct 30, 2023 at 05:07:48AM +0800, Mingli Zhang wrote: > > > > Bruce Momjian 于2023年10月30日周一03:35写道: > > > > On Sun, Oct 29, 2023 at 02:50:37PM +0800, Mingli Zhang wr

Should Explain show Parallel Hash node’s total rows?

2023-10-24 Thread Zhang Mingli
wandering if it’s more reasonable to show rows_total instead of plan_rows for Parallel Hash nodes? For this example, -> Parallel Hash (rows=2) -> Parallel Seq Scan on simple s (rows=8333) Zhang Mingli HashData https://www.hashdata.xyz

Re: list of acknowledgments for PG16

2023-10-19 Thread Zhang Mingli
As usual, please check for problems such as wrong sorting, duplicate names > in different variants, or names in the wrong order etc. (Our convention is > given name followed by surname.) > > Could you help me with Mingli Zhang -> Zhang Mingli Thanks. Zhang Mingli HashData https://www.hashdata.xyz

Re: Skip Orderby Execution for Materialized Views

2023-10-01 Thread Zhang Mingli
HI, > On Oct 1, 2023, at 22:54, Tom Lane wrote: > > For one example, > you can't just remove the sort clause if the query uses DISTINCT ON Hi, Tom, got it, thanks, Zhang Mingli HashData https://www.hashdata.xyz

Skip Orderby Execution for Materialized Views

2023-10-01 Thread Zhang Mingli
mvt1_order; REFRESH MATERIALIZED VIEW Time: 204.398 ms zml=# refresh materialized view mvt1_order; REFRESH MATERIALIZED VIEW Time: 197.510 ms Zhang Mingli www.hashdata.xyz v1-01-Skip-Orderby-clause-execution-for-Materialized-Views.patch Description: Binary data

Re: Fix typo in src/interfaces/libpq/po/zh_CN.po

2023-08-21 Thread Zhang Mingli
://git.postgresql.org/gitweb/?p=pgtranslation/messages.git;a=commitdiff;h=14391f71ca61e90d52502093447fe1ee0080116f > > -- > Daniel Gustafsson > Thanks, got it~ Zhang Mingli HashData https://www.hashdata.xyz

Re: Fix typo in src/interfaces/libpq/po/zh_CN.po

2023-08-19 Thread Zhang Mingli
> On Aug 16, 2023, at 22:24, Peter Eisentraut wrote: > > On 16.08.23 09:34, Zhang Mingli wrote: >> The Chinese words there are ok, but the `Unix-domian` should be >> `Unix-domain`. > > fixed, thanks > Hi, Peter, thanks and just want to make sure tha

Fix typo in src/interfaces/libpq/po/zh_CN.po

2023-08-16 Thread Zhang Mingli
Hi, The Chinese words there are ok,  but the `Unix-domian` should be `Unix-domain`. v1-0001-Fix-typo-src-interfaces-libpq-po-zh_CN.po.patch Description: Binary data Zhang MingliHashData https://www.hashdata.xyz

Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2023-07-31 Thread Zhang Mingli
On Aug 1, 2023, at 03:35, Andrew Dunstan wrote:I was hoping it be able to get to it today but that's not happening. If you want to submit a revised patch as above that will be good. I hope to get to it later this week.HI, Andrew Patch rebased and updated like above, thanks.

Re: [PATCH] Check more invariants during syscache initialization

2023-07-26 Thread Zhang Mingli
Hi, > On Jul 27, 2023, at 09:05, Michael Paquier wrote: > > One reason is that this increases the odds of > conflicts when backpatching on a stable branch. Agree. We could suggest to use OidIsValid() for new patches during review. Zhang Mingli https://www.hashdata.xyz

Re: [PATCH] Check more invariants during syscache initialization

2023-07-26 Thread Zhang Mingli
le (oid != 0) ``` That is another story…I would like provide a patch if it worths. Zhang Mingli https://www.hashdata.xyz

Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2023-07-26 Thread Zhang Mingli
> Perhaps we could fix the inconsistency by changing the force_quote_all > code to use MemSet() too. I'll defer whether to do that to Andrew's > judgement. Sure, let’s wait for Andrew and I will put everything in one pot then. Zhang Mingli https://www.hashdata.xyz

Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2023-07-20 Thread Zhang Mingli
tter, thanks again. Zhang Mingli www.hashdata.xyz

Re: harmonize password reuse in vacuumdb, clusterdb, and reindexdb

2023-07-18 Thread Zhang Mingli
HI, On Jun 29, 2023 at 13:24 +0800, Nathan Bossart , wrote: > > Connecting to different databases with the same > host/port/user information seems okay. Have a look, yeah, cluster_all_databases/vacuum_all_databases/reindex_all_databases will get there. LGTM. Regards, Zhang Mingli

Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2023-07-18 Thread Zhang Mingli
Hi, On Jul 9, 2023 at 11:51 +0800, Zhang Mingli , wrote: HI, Regards, Zhang Mingli On Jul 7, 2023, 18:00 +0800, Damir Belyalov , wrote: The patch does not work for the current version of postgres, it needs to be updated. I tested your patch. Everything looks simple and works well

Re: ObjectIdGetDatum() missing from SearchSysCache*() callers

2023-07-17 Thread Zhang Mingli
Hi, Regards, Zhang Mingli On Jul 17, 2023 at 21:09 +0800, Zhang Mingli , wrote: > sequence_options And inside pg_sequence_parameters: pgstuple = SearchSysCache1(SEQRELID, relid);

Re: ObjectIdGetDatum() missing from SearchSysCache*() callers

2023-07-17 Thread Zhang Mingli
Hi Regards, Zhang Mingli On Jul 17, 2023 at 19:10 +0800, Michael Paquier , wrote: > Hi all, > > While scanning the code, I have noticed that a couple of code paths > that do syscache lookups are passing down directly Oids rather than > Datums. I think that we'd better be consis

Re: Improve heapgetpage() performance, overhead from serializable

2023-07-16 Thread Zhang Mingli
Hi, Regards, Zhang Mingli On Jul 16, 2023 at 09:57 +0800, Andres Freund , wrote: > Hi, > > Several loops which are important for query performance, like heapgetpage()'s > loop over all tuples, have to call functions like > HeapCheckForSerializableConflictOut() and PredicateLoc

Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2023-07-08 Thread Zhang Mingli
HI, Regards, Zhang Mingli On Jul 7, 2023, 18:00 +0800, Damir Belyalov , wrote: > > The patch does not work for the current version of postgres, it needs to be > updated. > I tested your patch. Everything looks simple and works well. > > There is a suggestion to simplify

Re: Targetlist lost when CTE join

2023-06-28 Thread Zhang Mingli
column for each of the listed column pairs (in > the listed order), followed by any remaining columns from T1, followed by any > remaining columns from T2. Thanks for your help. Regards, Zhang Mingli

Re: Targetlist lost when CTE join

2023-06-28 Thread Zhang Mingli
Hi Regards, Zhang Mingli On Jun 28, 2023, 17:17 +0800, Julien Rouhaud , wrote: > This is working as intended. When using a USING clause you "merge" both > columns so the final target list only contain one version of the merged > columns, which doesn't happen if you use e

Re: Targetlist lost when CTE join

2023-06-28 Thread Zhang Mingli
ut: t1.c1, t1.c2  -> Hash (cost=0.02..0.02 rows=1 width=8)  Output: cte1.c1, cte1.c2  -> CTE Scan on cte1 (cost=0.00..0.02 rows=1 width=8)  Output: cte1.c1, cte1.c2 (14 rows) Regards, Zhang Mingli

Targetlist lost when CTE join

2023-06-28 Thread Zhang Mingli
oin t1 using(c1);  c1 | c2 | c1 | c2 +++ (0 rows) Table t1 and  t2 both has 2 columns: c1, c2, when CTE join select *, the result target list seems to lost one’s column c1. But it looks good when select cte1.* and t1.* explicitly . Is it a bug? Regards, Zhang Mingli

Re: Fix the miss consideration of tuple_fraction during add_paths_to_append_rel

2023-04-10 Thread Zhang Mingli
else if (childrel->pathlist != NIL &&   childrel->cheapest_total_path->param_info == NULL)   accumulate_append_subpath(childrel->cheapest_total_path,      , NULL); Could we also consider tuple_fraction in partial_pathlist for  parallel append? Regards, Zhang Mingli

SELECT INTO without columns or star

2023-03-31 Thread Zhang Mingli
empty rows but not null. Is it an expected behavior? And what’s the semantic of SELECT INTO without any columns? I also see lots of that SELECT INTO in out test cases like: -- SELECT INTO doesn't support USING SELECT INTO tableam_tblselectinto_heap2 USING heap2 FROM tableam_tbl_heap2; Regards, Zhang Mingli

Fix typo plgsql to plpgsql.

2023-03-20 Thread Zhang Mingli
Hi, all Found several typos like plgsql, I think it should be plpgsql. Regards, Zhang Mingli 0001-Fix-typo-plgsql-to-plpgsql.patch Description: Binary data

Re: Code review in dsa.c

2023-01-15 Thread Zhang Mingli
HI, On Jan 16, 2023, 00:10 +0800, Nathan Bossart , wrote: > On Mon, Jan 16, 2023 at 12:04:56AM +0800, Zhang Mingli wrote: > > So, they are all dead codes, provide a patch to remove them. > > I am proposing a new use of dsa_create, dsa_attach, and dsa_get_ha

Re: Code review in dsa.c

2023-01-15 Thread Zhang Mingli
HI, On Jan 15, 2023, 23:43 +0800, Zhang Mingli , wrote: > Hi, hackers > > Found  some functions in dsa.c are not used anymore. > > dsa_create > dsa_attach > dsa_get_handle > dsa_trim > dsa_dump > > We once used dsa_create to create DSA and  it ’s all replace

Code review in dsa.c

2023-01-15 Thread Zhang Mingli
. dsa_trim and dsa_dump are introduced by DSA original commit 13df76a537 , but not used since then. So, they are all dead codes, provide a patch to remove them. Regards, Zhang Mingli v0-0001-Remove-unused-functions-in-dsa.c.patch Description: Binary data

Re: Fix condition in shm_toc and remove unused function shm_toc_freespace.

2023-01-13 Thread Zhang Mingli
Hi, Regards, Zhang Mingli On Jan 12, 2023, 16:54 +0800, Richard Guo , wrote: > > On Thu, Jan 12, 2023 at 2:50 PM Zhang Mingli wrote: > > On Jan 12, 2023, 14:34 +0800, Zhang Mingli , wrote: > > > Some conditions in shm_toc_insert and shm_toc_allocate are bogus, like: > >

Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2023-01-13 Thread Zhang Mingli
= cstate->attnumlist; else attnums = CopyGetAttnums(tupDesc, cstate->rel, cstate->opts.force_notnull); // process force_notnull columns } ``` Any other suggestions? Regards, Zhang Mingli

Re: Fix condition in shm_toc and remove unused function shm_toc_freespace.

2023-01-11 Thread Zhang Mingli
Hi, On Jan 12, 2023, 14:34 +0800, Zhang Mingli , wrote: > Hi, hackers > > Some conditions in shm_toc_insert and shm_toc_allocate are bogus, like: > if (toc_bytes + nbytes > total_bytes || toc_bytes + nbytes < > toc_bytes) > Remove the condition `toc_by

Fix condition in shm_toc and remove unused function shm_toc_freespace.

2023-01-11 Thread Zhang Mingli
Release(>toc_mutex); shm_toc_freespace is introduced with shm_toc by original commit 6ddd5137b2, but is not used since then, so remove it. Regards, Zhang Mingli v0-0001-Fix-condition-in-shm_toc-and-remove-unused-functi.patch Description: Binary data

Remove unused param rte in set_plain_rel_pathlist

2022-11-12 Thread Zhang Mingli
Hi, hackers Param RangeTblEntry *rte in function set_plain_rel_pathlist is not used at all. I look at the commit e2fa76d80b(10 years ago), it’s useless since then. Add a path to remove it. Regards, Zhang Mingli v1-0001-Remove-unused-param-rte-in-set_plain_rel_pathlist.patch Description

What’s the usage of SO_TYPE_ANALYZE

2022-11-10 Thread Zhang Mingli
t find a place to handle that option. Do we miss something?  ex: forget handle it in table_endscan. Else, it’s  not used at all. The first commit introduced this option is c3b23ae457. Other commits modify this option just changed the enum order. Regards, Zhang Mingli

Re: [patch] Adding an assertion to report too long hash table name

2022-11-07 Thread Zhang Mingli
ared Buffer Lookup Table” ``` But it will help for other Databases built on Postgres or later Postgres in case of forgetting to update SHMEM_INDEX_KEYSIZE when new shmem added with a name longer than current SHMEM_INDEX_KEYSIZE. And we don’t have such assertion now. So, +1 for the patch. Regards, Zhang Mingli

Re: [PoC] Reducing planning time when tables have many partitions

2022-11-06 Thread Zhang Mingli
HI, Regards, Zhang Mingli On Nov 7, 2022, 14:26 +0800, Tom Lane , wrote: > Andrey Lepikhov writes: > > I'm still in review of your patch now. At most it seems ok, but are you > > really need both eq_sources and eq_derives lists now? > > Didn't we just have this conversat

Re: Free list same_input_transnos in preprocess_aggref

2022-11-06 Thread Zhang Mingli
r example, while the > regression tests give > > 49 LOG: freeing list of length 0 > 2 LOG: freeing list of length 1 > Thanks for the investigation. Yeah, this patch is negligible. I’ll withdraw it in CF. Regards, Zhang Mingli

Re: Lock on ShmemVariableCache fields?

2022-10-31 Thread Zhang Mingli
;oidCount? > > If the lock is unnecessary, I think adding some comments is better. > > -- > Regrads, > Japin Li. > ChengDu WenWu Information Technology Co.,Ltd. > > As its name BootStrapXLOG, it’s used in BootStrap mode to initialize the template database. The process doesn’t speak SQL and the database is not ready. There won’t be  concurrent access to variables. Regards, Zhang Mingli >

Re: Reducing duplicativeness of EquivalenceClass-derived clauses

2022-10-27 Thread Zhang Mingli
Hi, On Oct 27, 2022, 21:29 +0800, Tom Lane , wrote: > Zhang Mingli writes: > > How about combine ec->ec_sources and ec->derives as one list for less codes? > > Keeping them separate is required for the broken-EC code paths. > Even if it weren't, I wouldn't merge th

Re: Reducing duplicativeness of EquivalenceClass-derived clauses

2022-10-27 Thread Zhang Mingli
= (RestrictInfo *) lfirst(lc);  if (rinfo->left_em == leftem &&  rinfo->right_em == rightem &&  rinfo->parent_ec == parent_ec)  return rinfo;  if (rinfo->left_em == rightem &&  rinfo->right_em == leftem &&  rinfo->parent_ec == parent_ec)  return rinfo; } ``` I have a try, it will change some in join.out and avoid changes in tidscan.out. Regards, Zhang Mingli >

Re: doubt about FullTransactionIdAdvance()

2022-10-23 Thread Zhang Mingli
Hi, Andres On Oct 24, 2022, 01:16 +0800, Andres Freund , wrote: > Hi, > > On 2022-10-22 11:32:47 +0800, Zhang Mingli wrote: > > Hi, hackers > > > > I don't quite understand FullTransactionIdAdvance(), correct me if I’m > > wrong. > > > > >

doubt about FullTransactionIdAdvance()

2022-10-21 Thread Zhang Mingli
other confusion is the comments: /* see FullTransactionIdAdvance() */, is its own  itself. Could anyone explain this? Thanks in advance. Regards, Zhang Mingli

Re: Add 64-bit XIDs into PostgreSQL 15

2022-10-21 Thread Zhang Mingli
make it more "tidy". > > > > Reviews and opinions are very welcome! > > > > -- > > Best regards, > > Maxim Orlov. Found some outdate code comments around several variables, such as xidWrapLimit/xidWarnLimit/xidStopLimt. These variables are not used any more. I

Documentation refinement for Parallel Scans

2022-10-19 Thread Zhang Mingli
56788d2156, each parallel worker will try to get ranges of blocks “chunks". Access to the table remains sequential inside each worker’s process, but not across all workers or the parallel query. Shall we update the documents? Regards, Zhang Mingli

Re: Issue in GIN fast-insert: XLogBeginInsert + Read/LockBuffer ordering

2022-10-12 Thread Zhang Mingli
t XLogRegisterBuffer() call. > > Would any of you like to write a patch? > -- > Michael Patch added. Regards, Zhang Mingli v2-0001-Fix-GIN-fast-path-XLogBeginInsert-and-Read-LockBu.patch Description: Binary data

Re: get rid of Abs()

2022-10-04 Thread Zhang Mingli
3, also found some places where could use fabsf instead of fabs if possible, add a patch to replace them. Regards, Zhang Mingli v2-0005-replace-fabs-with-fabsf-if-possible.patch Description: Binary data

Re: Issue in GIN fast-insert: XLogBeginInsert + Read/LockBuffer ordering

2022-09-30 Thread Zhang Mingli
SECTION(); ``` Shall we adjust that too? Regards, Zhang Mingli

Re: Issue in GIN fast-insert: XLogBeginInsert + Read/LockBuffer ordering

2022-09-30 Thread Zhang Mingli
> > PFA a patch that rectifies this issue, by moving the XLogBeginInsert() > down to where 1.) we have all relevant buffers pinned and locked, and > 2.) we're in a critical section, making that part of the code > consistent with the general scheme for XLog insertion. +1, Make sense. Regards, Zhang Mingli

Re: Summary function for pg_buffercache

2022-09-29 Thread Zhang Mingli
anks, > Melih Looks good to me. Regards, Zhang Mingli

Re: Refactor UnpinBuffer()

2022-09-28 Thread Zhang Mingli
)? From my quick skim of the code, it > seems like it should be safe, but I thought I'd ask the question. Same question, have a look, it doesn’t seem to matter. Regards, Zhang Mingli

Re: Summary function for pg_buffercache

2022-09-28 Thread Zhang Mingli
Hi, On Sep 28, 2022, 22:41 +0800, Melih Mutlu , wrote: > > > Zhang Mingli , 28 Eyl 2022 Çar, 17:31 tarihinde şunu > yazdı: > > Why compute usagecount_avg twice? > > I should have removed the first one, but I think I missed it. > Nice catch. > > Attached an upd

Re: Summary function for pg_buffercache

2022-09-28 Thread Zhang Mingli
Regards, Zhang Mingli On Sep 28, 2022, 21:50 +0800, Melih Mutlu , wrote: > Hi all, > > The patch needed a rebase due to recent changes on pg_buffercache. > You can find the updated version attached. > > Best, > Melih > > ``` + + if (buffers_used != 0) + usag

Re: Add more docs for pg_surgery?

2022-09-27 Thread Zhang Mingli
Regards, Zhang Mingli On Sep 27, 2022, 00:47 +0800, Ashutosh Sharma , wrote: > > And further it looks like you are doing an > experiment on undamaged relation which is not recommended as > documented. Yeah. >  If the relation would have been damaged, you probably may > not

Add more docs for pg_surgery?

2022-09-26 Thread Zhang Mingli
with great caution and only as a last resort. ``` I know they are powerful tools, but also a little surprise with the above example. Should we add more docs to tell the users that the tool will change the tuples anyway even there are tuple-locks on them? Regards, Zhang Mingli

Re: Removing unused parameter in SnapBuildGetOrBuildSnapshot

2022-09-21 Thread Zhang Mingli
needs transaction id. This also makes the xid parameter in > SnapBuildGetOrBuildSnapshot useless. > I couldn't see a reason to keep it and decided to remove it. > > Regards, > Melih +1, Good Catch. Regards, Zhang Mingli

Re: Virtual tx id

2022-09-20 Thread Zhang Mingli
rocess to see( must exec a read only sql to call StartTransaction, else MyProc->lxid is not assigned). ``` Begin; // do nothing ``` gdb on it and see ``` p MyProc->lxid p MyProc->backendId ``` Regards, Zhang Mingli

Re: Summary function for pg_buffercache

2022-09-20 Thread Zhang Mingli
Hi, On Sep 20, 2022, 20:49 +0800, Melih Mutlu , wrote: > Hi Zhang, > > Those are two different locks. > The locks that are taken in the patch are for buffer headers. This locks only > the current buffer and makes that particular buffer's info consistent within > itself. > > However, the lock

Re: Summary function for pg_buffercache

2022-09-20 Thread Zhang Mingli
Hi, Regards, Zhang Mingli On Sep 20, 2022, 20:43 +0800, Aleksander Alekseev , wrote: > > Correct, the procedure doesn't take the locks of the buffer manager. > It does take the locks of every individual buffer. Ah, now I get it, thanks.

Re: Summary function for pg_buffercache

2022-09-20 Thread Zhang Mingli
. This is  intentional. The purpose of this function is to provide a general idea about  the state of shared buffers as fast as possible. Additionally,  pg_buffercache_summary allocates much less memory. ``` Regards, Zhang Mingli On Sep 20, 2022, 20:10 +0800, Melih Mutlu , wrote: > Hi, > &

Re: Add 64-bit XIDs into PostgreSQL 15

2022-09-20 Thread Zhang Mingli
Hi, On Sep 20, 2022, 17:26 +0800, Justin Pryzby , wrote: > On Tue, Sep 20, 2022 at 03:37:47PM +0800, Zhang Mingli wrote: > > I want to have a look at these patches, but apply on master failed: > > Yeah, it's likely to break every week or more often. > > You have a few op

Re: Add 64-bit XIDs into PostgreSQL 15

2022-09-20 Thread Zhang Mingli
at wraparound */     do     {         result = nextLocalTransactionId++;     } while (!LocalTransactionIdIsValid(result));     return result; } ``` Regards, Zhang Mingli

Re: Add 64-bit XIDs into PostgreSQL 15

2022-09-20 Thread Zhang Mingli
, Zhang Mingli

Re: Free list same_input_transnos in preprocess_aggref

2022-09-19 Thread Zhang Mingli
Regards, Zhang Mingli On Sep 20, 2022, 00:27 +0800, Zhang Mingli , wrote: > > SaveBytes = Sum results of accumulate_list_size: 32(4+4+8+8), as we have 5 > aggs in sql Correction: SaveBytes = Sum results of accumulate_list_size: 24(4+4+8+8),

Re: Free list same_input_transnos in preprocess_aggref

2022-09-19 Thread Zhang Mingli
Regards, Zhang Mingli On Sep 19, 2022, 23:14 +0800, Tom Lane , wrote: > Very little of the planner bothers with freeing small allocations > like that. I think so too, as said, not sure if it worths. > Can you demonstrate a case where this would actually > make a meaningful differe

Free list same_input_transnos in preprocess_aggref

2022-09-19 Thread Zhang Mingli
. But as in find_compatible_agg(), the list is freed if we found a compatible Agg. This patch helps a little when there are lots of incompatible aggs because we will try to find the compatible transnos again and again. Each iteration will keep an unused list memory. Regards, Zhang Mingli vn-0001

Re: Fix typos in code comments

2022-09-18 Thread Zhang Mingli
Hi On Sep 19, 2022, 10:57 +0800, Amit Kapila , wrote: > On Mon, Sep 19, 2022 at 8:14 AM houzj.f...@fujitsu.com > wrote: > > > > While working on some other patches, I found serval typos(duplicate words > > and > > incorrect function name reference) in the code comments. Here is a small > >

Re: Remove dead macro exec_subplan_get_plan

2022-09-16 Thread Zhang Mingli
On Sep 16, 2022, 14:47 +0800, Richard Guo , wrote: > > On Tue, Sep 6, 2022 at 12:39 AM Zhang Mingli wrote: > > Macro exec_subplan_get_plan is not used anymore. > > Attach a patch to remove it. > > How about add it to the CF to not lose track of it? Will add it, thanks~ Regards, Zhang Mingli

Removed unused param isSlice of function transformAssignmentSubscripts

2022-09-12 Thread Zhang Mingli
Hi, Param isSlice was once used to identity targetTypeId for transformAssignmentIndirection. In commit c7aba7c14e, the evaluation was pushed down to transformContainerSubscripts. No need to keep isSlice around transformAssignmentSubscripts. Attach a patch to remove it. Regards, Zhang

Re: pg15b4: FailedAssertion("TransactionIdIsValid(xmax)

2022-09-09 Thread Zhang Mingli
if we can reproduce it. And could we see multixact reply in logs if db does recover? Regards, Zhang Mingli

Re: Out-of-date comments about RecentGlobalXmin?

2022-09-06 Thread Zhang Mingli
Hi, Regards, Zhang Mingli On Sep 6, 2022, 16:03 +0800, Japin Li , wrote: > > In commit dc7420c2c9, the RecentGlobalXmin variable is removed, however, > there are some places that reference it. > > $ grep 'RecentGlobalXmin' -rn src/ > src/backend/replication/logical/launcher.c:10

Re: Remove dead macro exec_subplan_get_plan

2022-09-06 Thread Zhang Mingli
Hi,all Regards, Zhang Mingli On Sep 6, 2022, 10:22 +0800, Richard Guo , wrote: > > On Tue, Sep 6, 2022 at 1:18 AM Tom Lane wrote: > > Zhang Mingli writes: > > > Macro exec_subplan_get_plan is not used anymore. > > > Attach a patch to remove it. > > > &

Remove dead macro exec_subplan_get_plan

2022-09-05 Thread Zhang Mingli
Hi, Macro exec_subplan_get_plan is not used anymore. Attach a patch to remove it. Regards, Zhang Mingli vn-0001-exec_subplan_get_plan-is-not-used.patch Description: Binary data

Fix typo kill_prio_tuple

2022-08-22 Thread Zhang Mingli
Hi, Found a typo in mvcc.sql typo kill_prio_tuple -> kill_prior_tuple Regards, Zhang Mingli vn-0001-Fix-typo-kill_prio_tuple-to-kill_prior_tuple.patch Description: Binary data

[patch]HashJoin crash

2022-08-12 Thread Zhang Mingli
ash_table_bytes < bucket_size) +   sbuckets = 1; + else +   sbuckets = pg_nextpower2_size_t(hash_table_bytes / bucket_size); ``` Or, we could report an error/hit message to tell users to increase work_mem/hash_mem_multiplier. And I think let it work is better. The issue exists on master, 15, 14,

Re: A cost issue in ORDER BY + LIMIT

2022-08-06 Thread Zhang Mingli
HI, What if the the rows of t1 is less than the limit number(ex: t1 has 5 rows, limit 10)? Does it matter? Regards, Zhang Mingli On Aug 6, 2022, 23:38 +0800, Paul Guo , wrote: > > limit_tuples

Re: Allocator sizeof operand mismatch (src/backend/regex/regcomp.c)

2022-08-06 Thread Zhang Mingli
On Aug 6, 2022, 22:47 +0800, Tom Lane , wrote: > Zhang Mingli writes: > > I think it’s ok, re_guts is converted when  used > > (struct guts *) re->re_guts; > > And there is comments in regex.h > > char *re_guts; /* `char *' is more portable than `void *' */ > &

Re: Allocator sizeof operand mismatch (src/backend/regex/regcomp.c)

2022-08-06 Thread Zhang Mingli
I think it’s ok, re_guts is converted when  used (struct guts *) re->re_guts; And there is comments in regex.h char *re_guts; /* `char *' is more portable than `void *' */ Regards, Zhang Mingli On Aug 6, 2022, 20:13 +0800, Ranier Vilela , wrote: > Hi, > > About the err

Re: [Code Comments]enum COPY_NEW_FE is removed

2022-08-06 Thread Zhang Mingli
Ok, thanks. Michael Paquier 于2022年8月6日 周六20:17写道: > On Sat, Aug 06, 2022 at 07:20:25PM +0800, Zhang Mingli wrote: > > Enum COPY_NEW_FE is removed in commit 3174d69fb9. > > > > Should use COPY_FRONTEND instead. > > > > Issue exists on 15 and master. > > Thi

[Code Comments]enum COPY_NEW_FE is removed

2022-08-06 Thread Zhang Mingli
*/ ``` Regards, Zhang Mingli v-0001-Fix-code-comments-COPY_FRONTEND.patch Description: Binary data

Re: COPY TO (FREEZE)?

2022-08-02 Thread Zhang Mingli
Regards, Zhang Mingli On Aug 2, 2022, 12:30 +0800, Kyotaro Horiguchi , wrote: > I noticed that COPY TO accepts FREEZE option but it is pointless. > > Don't we reject that option as the first-attached does? I +1, should be rejected like other invalid options. > > regards. &

Re: [Refactor]Avoid to handle FORCE_NOT_NULL/FORCE_NULL options when COPY TO

2022-08-02 Thread Zhang Mingli
Regards, Zhang Mingli On Aug 2, 2022, 12:30 +0800, Kyotaro Horiguchi , wrote: > An empty List is not NULL but NIL (which values are identical, > though). Thanks for pointing that out. Fix it in new patch. > There are some other option combinations that are rejected > by Proces

[feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns

2022-08-01 Thread Zhang Mingli
a, b, c, d) FROM STDIN WITH (FORMAT csv, FORCE_NOT_NULL *, FORCE_NULL *);  2,'b',,""  \.  COMMIT;  SELECT c, d FROM forcetest WHERE a = 2;  c | d  ---+--  | NULL  (1 row) Any thoughts? Regards, Zhang Mingli v0001-COPY-FROM-enable-FORCE_NULL-FORCE_NOT_NULL-on-all-columns.patch Description: Binary data

Re: [Refactor]Avoid to handle FORCE_NOT_NULL/FORCE_NULL options when COPY TO

2022-07-31 Thread Zhang Mingli
HI, More assertions added. Thanks. Regards, Zhang Mingli On Jul 29, 2022, 11:24 +0800, Richard Guo , wrote: > > > On Thu, Jul 28, 2022 at 9:04 PM Zhang Mingli wrote: > > > Assertions added. > > > > Can we also add assertions to make sure force_quote, fo

Re: COPY FROM FORMAT CSV FORCE_NULL(*) ?

2022-07-28 Thread Zhang Mingli
Hi, Agree, FORCE_NULL(*) is useful as well as FORCE_NOT_NULL(*). We can have them both. They are useful when users copy tables that have many columns. Regards, Zhang Mingli On Jul 25, 2022, 21:28 +0800, Andrew Dunstan , wrote: > > On 2022-07-25 Mo 00:18, jian he wrote:

Re: Patch to address creation of PgStat* contexts with null parent context

2022-07-28 Thread Zhang Mingli
─ > > > > print CacheMemoryContext == NULL > $4 = 1 > > > > print parent > $5 = (MemoryContext) 0x0 > > Thanks, > Reid > > Codes seem good, my question is: Do auto vacuum processes need CacheMemoryContext? Is it designed not to  create CacheMemoryContext in such processes? If so, we’d better use TopMemoryContext in such processes. Regards, Zhang Mingli

Re: [Refactor]Avoid to handle FORCE_NOT_NULL/FORCE_NULL options when COPY TO

2022-07-28 Thread Zhang Mingli
Hi, all Assertions added. Thanks for review. Regards, Zhang Mingli Sent with a Spark On Jul 27, 2022, 14:37 +0800, Richard Guo , wrote: > > > On Wed, Jul 27, 2022 at 12:55 PM Kyotaro Horiguchi > > wrote: > > > ProcessCopyOptions previously rejects force

Re: Fix annotations nextFullXid

2022-07-26 Thread Zhang Mingli
Thanks! Regards, Zhang Mingli > On Jul 26, 2022, at 10:08, Fujii Masao wrote: > > > > On 2022/07/23 14:01, Zhang Mingli wrote: >> Hi, >> VariableCacheData.nextFullXid is renamed to nextXid in commit >> https://github.com/postgres/postgres//commit/fea10a6

[Refactor]Avoid to handle FORCE_NOT_NULL/FORCE_NULL options when COPY TO

2022-07-26 Thread Zhang Mingli
-FORCE_NULL-options.patch Description: Binary data Regards,Zhang Mingli

Re: optimize lookups in snapshot [sub]xip arrays

2022-07-25 Thread Zhang Mingli
’m not familiar with SIMD, will try to review this patch. Regards, Zhang Mingli

  1   2   >