effective SELECT from child tables - Mailing list pgsql-hackers

From Ilia Kantor
Subject effective SELECT from child tables
Date
Msg-id auto-000571351417@umail.ru
Whole thread Raw
Responses Re: effective SELECT from child tables
Re: effective SELECT from child tables
Re: effective SELECT from child tables
List pgsql-hackers
<div class="Section1"><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-US" style="font-size:
10.0pt;font-family:Arial">Let table A be inherited by A1, A2, A3.</span></font><p class="MsoNormal"><font face="Arial"
size="2"><spanlang="EN-US" style="font-size: 
10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-US"
style="font-size:
10.0pt;font-family:Arial">How to select from A records where actual relations are A1, A2 ?</span></font><p
class="MsoNormal"><fontface="Arial" size="2"><span lang="EN-US" style="font-size: 
10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-US"
style="font-size:
10.0pt;font-family:Arial">I found a way somewhere, it sounds like SELECT  … WHERE tableoid IN (a1.oid,
a2.oid),</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span lang="EN-US" style="font-size: 
10.0pt;font-family:Arial">but tableoid checks actually do seq scan.</span></font><p class="MsoNormal"><font
face="Arial"size="2"><span lang="EN-US" style="font-size: 
10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-US"
style="font-size:
10.0pt;font-family:Arial">Like: SELECT * FROM sometable WHERE tableoid =anything will do seq. scan on
sometable..</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span lang="EN-US" style="font-size: 
10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-US"
style="font-size:
10.0pt;font-family:Arial">So such way seems very ineffective: it seq scans and filters records..</span></font><p
class="MsoNormal"><fontface="Arial" size="2"><span lang="EN-US" style="font-size: 
10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-US"
style="font-size:
10.0pt;font-family:Arial">Maybe new constraint_exclusion staff could help to exclude non-matching tables from
inheritancequery ?</span></font></div> 

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Making pgxs builds work with a relocated installation
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #1883: Renaming a schema leaves inconsistent