Re: Index scan is not pushed down to union all subquery

2023-10-09 Thread Lauri Kajan
On Thu, Oct 5, 2023 at 4:25 PM Lauri Kajan wrote: > In my dreams the plan would be something like this: > Nested Loop > -> Index Scan using dealers_pkey on dealers > Index Cond: (id = ANY ('{54,12,456,315,468}'::integer[])) > -> Append > -> Bitmap Heap Scan on bikes >

Re: Index scan is not pushed down to union all subquery

2023-10-05 Thread Lauri Kajan
On Thu, Oct 5, 2023 at 12:30 PM Marian Wendt wrote: > > With an INNER JOIN, both tables must be fully checked/matched (check using EXPLAIN ANALYSIS -> HashJoin), so the index cannot be used here. > Sorry, didn't consider the WITH part. Please share the detailed query plan for more info. Now, it r

Re: Index scan is not pushed down to union all subquery

2023-10-05 Thread Dominique Devienne
On Thu, Oct 5, 2023 at 11:35 AM Marian Wendt wrote: > With an INNER JOIN, both tables must be fully checked/matched (check using > EXPLAIN ANALYSIS -> HashJoin), so the index cannot be used here. > Sorry, didn't consider the WITH part. Please share the detailed query > plan for more info. > > The

Re: Index scan is not pushed down to union all subquery

2023-10-05 Thread Marian Wendt
Hi, Is it intended that indexes are not pushed down to union all subqueries if even a single select contains a where clause? Is this just not implemented, is it impossible to implement or am I doing something wrong? The following query does a SeqScan for "bikes" and "cars" tables even though Ind

Re: Index scan is not pushed down to union all subquery

2023-10-05 Thread Marian Wendt
Hi, Is it intended that indexes are not pushed down to union all subqueries if even a single select contains a where clause? Is this just not implemented, is it impossible to implement or am I doing something wrong? The following query does a SeqScan for "bikes" and "cars" tables even though Ind

Re: Index scan is not pushed down to union all subquery

2023-10-05 Thread Marian Wendt
Hi, Is it intended that indexes are not pushed down to union all subqueries if even a single select contains a where clause? Is this just not implemented, is it impossible to implement or am I doing something wrong? The following query does a SeqScan for "bikes" and "cars" tables even though Ind