Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Hackers > TidScan needs h...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 9286 of 9628
Post > Topic >>

TidScan needs handling of a corner cases

by singh.gurjeet@[EMAIL PROTECTED] ("Gurjeet Singh") Apr 30, 2008 at 11:24 PM

------=_Part_3056_30409245.1209578061172
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi All,

    I noticed that the TidScan fails to identify when the requested block
is
not in the relation. Consider this (pg_class has 6 blocks):

postgres=# explain analyze select ctid, * from pg_class where ctid in (
'(6,1)' );
ERROR:  could not read block 6 of relation 1663/11511/1259: read only 0 of
8192 bytes

    Also, it is known that 0 is not a valid row-offset in the block, but
the
tid input function accepts this value (it rejects -ve values). For the
same
setup:

postgres=#  explain analyze select ctid, * from pg_class where ctid in (
'(6,0)' );
                                             QUERY
PLAN
----------------------------------------------------------------------------------------------------
 Tid Scan on pg_class  (cost=0.00..4.01 rows=1 width=211) (actual
time=0.009..0.009 rows=0 loops=1)
   TID Cond: (ctid = '(6,0)'::tid)
 Total runtime: 0.130 ms
(3 rows)

    Can we safely fix these? First one by ignoring the request if
requested_block >= RelationGetNumberOfBlocks(), and second one by
accepting
only non-zero positive values in the tid input function.

Best regards

-- 
gurjeet[.singh]@[EMAIL PROTECTED]
 gmail | hotmail | indiatimes | yahoo }.com

EnterpriseDB http://www.enterprisedb.com

Mail sent from my BlackLaptop device

------=_Part_3056_30409245.1209578061172
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi All,<br><br>&nbsp;&nbsp;&nbsp; I noticed that the TidScan fails to
identify when the requested block is not in the relation. Consider this
(pg_class has 6 blocks):<br><br>postgres=# explain analyze select ctid, *
from pg_class where ctid in ( &#39;(6,1)&#39; );<br>
ERROR:&nbsp; could not read block 6 of relation 1663/11511/1259: read only
0 of 8192 bytes<br><br>&nbsp;&nbsp;&nbsp; Also, it is known that 0 is not a
valid row-offset in the block, but the tid input function accepts this
value (it rejects -ve values). For the same setup:<br>
<br>postgres=#&nbsp; explain analyze select ctid, * from pg_class where
ctid in ( &#39;(6,0)&#39;
);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
QUERY
PLAN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>----------------------------------------------------------------------------------------------------<br>
&nbsp;Tid Scan on pg_class&nbsp; (cost=0.00..4.01 rows=1 width=211)
(actual time=0.009..0.009 rows=0 loops=1)<br>&nbsp;&nbsp; TID Cond: (ctid
= &#39;(6,0)&#39;::tid)<br>&nbsp;Total runtime: 0.130 ms<br>(3
rows)<br><br>&nbsp;&nbsp;&nbsp; Can we safely fix these? First one by
ignoring the request if&nbsp; requested_block &gt;=
RelationGetNumberOfBlocks(), and second one by accepting only non-zero
positive values in the tid input function.<br>
<br>Best regards<br><br>--
<br>gurjeet[.singh]@[EMAIL PROTECTED]
>singh.gurjeet@[EMAIL PROTECTED]
 gmail | hotmail |
indiatimes | yahoo }.com<br><br>EnterpriseDB <a
href="http://www.enterprisedb.com">http://www.enterprisedb.com</a><br><br>
Mail sent from my BlackLaptop device

------=_Part_3056_30409245.1209578061172--




 2 Posts in Topic:
TidScan needs handling of a corner cases
singh.gurjeet@[EMAIL PROT  2008-04-30 23:24:21 
Re: TidScan needs handling of a corner cases
tgl@[EMAIL PROTECTED] (T  2008-04-30 17:03:58 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Fri Jul 4 9:27:09 CDT 2008.