Re: Some ExecSeqScan optimizations

From: Vladlen Popolitov <v(dot)popolitov(at)postgrespro(dot)ru>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Junwang Zhao <zhjwpku(at)gmail(dot)com>
Subject: Re: Some ExecSeqScan optimizations
Date: 2025-01-10 14:49:01
Message-ID: fe89f0b90db3677ccd9359d2424385a5@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Amit Langote писал(а) 2025-01-10 18:22:
> On Fri, Jan 10, 2025 at 7:36 PM David Rowley <dgrowleyml(at)gmail(dot)com>
> wrote:
>> On Fri, 10 Jan 2025 at 22:53, Vladlen Popolitov
>> <v(dot)popolitov(at)postgrespro(dot)ru> wrote:
>> > In case of query
>> > select count(*) from test_table where a_1 = 1000000;
>> > I would expect increase of query time due to additional if...else . It
>> > is not clear
>> > what code was eliminated to decrease query time.
>>
>> Are you talking about the code added to ExecInitSeqScan() to determine
>> which node function to call? If so, that's only called during executor
>> startup. The idea here is to reduce the branching during execution by
>> calling one of those special functions which has a more specialised
>> version of the ExecScan code for the particular purpose it's going to
>> be used for.
>
> Looks like I hadn't mentioned this key aspect of the patch in the
> commit message, so did that in the attached.
>
> Vladlen, does what David wrote and the new commit message answer your
> question(s)?

Hi Amit,

Yes, David clarified the idea, but it is still hard to believe in 5% of
improvements.
The query
select count(*) from test_table where a_1 = 1000000;
has both qual and projection, and ExecScanExtended() will be generated
similar to ExecScan() (the same not NULL values to check in if()).
Do you have some scripts to reproduce your benchmark?
--
Best regards,

Vladlen Popolitov.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2025-01-10 14:50:32 tests for pg_stat_progress_copy.tuples_skipped
Previous Message Fujii Masao 2025-01-10 14:39:13 Re: pgbench error: (setshell) of script 0; execution of meta-command failed