Re: Scans are offloaded to SeqScan instead of CustomScan when there are multiple relations in the same query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Amin <amin(dot)fallahi(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Scans are offloaded to SeqScan instead of CustomScan when there are multiple relations in the same query
Date: 2023-04-17 22:45:33
Message-ID: 2525827.1681771533@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Amin <amin(dot)fallahi(at)gmail(dot)com> writes:
> To simplify: Can CustomScan scan multiple relations in the same query or it
> will always be assigned to one or zero relations?

There's barely any code in the core planner that is specific to custom
scans. Almost certainly this misbehavior is the fault of your
custom-path-creation code. Maybe you're labeling the paths with the
wrong parent relation, or forgetting to submit them to add_path,
or assigning them costs that are high enough to get them rejected?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-04-17 23:52:11 Re: check_strxfrm_bug()
Previous Message Peter Geoghegan 2023-04-17 22:40:14 Re: check_strxfrm_bug()