Re: Optimize MCV stats for sortable types and utilize sorted-order properties

From: ZizhuanLiu X-MAN <44973863(at)qq(dot)com>
To: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com>, tgl <tgl(at)sss(dot)pgh(dot)pa(dot)us>, tomas <tomas(at)vondra(dot)me>, dean(dot)a(dot)rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, guofenglinux <guofenglinux(at)gmail(dot)com>
Subject: Re: Optimize MCV stats for sortable types and utilize sorted-order properties
Date: 2026-10-13 10:32:41
Message-ID: tencent_EB31141EABCD91F665A2F45BCA72899AB205@qq.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I made the following changes:
- Simplified stats_import.sql by using the check_sql helper to execute the queries and verify the results.
This significantly reduces the duplicated content between stats_import.sql and stats_import.out.
- I also modified the query used for checking imported statistics to avoid outputting environment-dependent fields,
such as tableid, statistics_id, and statistics_owner. These fields are not essential for the regression test and could
cause unnecessary differences across environments.

- Added test cases in collate.icu.utf8.sql and corresponding expected output in collate.icu.utf8.out to verify whether
scanning the entire MCV array is needed.

Thanks for the review.

regards,
--
ZizhuanLiu (X-MAN) 
44973863(at)qq(dot)com

Attachment Content-Type Size
v12-0001-Optimize-MCV-statistics-for-sortable-types.patch application/octet-stream 114.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Shubhankar Anand Kulkarni 2026-10-13 10:37:35 Re: PG19: flat-copied RelOptInfos share extension_state with the original rel
Previous Message shveta malik 2026-10-13 10:28:52 Re: Proposal: Conflict log history table for Logical Replication