<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">As for patch itself, I don’t like the idea to store rowid for ephemeral space<br class="">in cursor: if insertion in such space occurred not via SQL facilities, then<br class="">rowid would be wrong…Well, we know that rowid is always in<br class="">the last field, so why just don’t fetch value from last field and increment it?<br class=""></blockquote><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Rowid cannot be stored in the last field, because tuples are sorted by the first parts.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>Wait, where is rowid stored now? AFAIU it is still placed in the last field.</div><br class=""><blockquote type="cite" class=""><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">That means that means that greatest tuple may not has the greatest rowid.</span></div></blockquote><br class=""><div>Now I am thinking about introducing secondary index for table with rowid on the last field.</div><div>Could you take a look at code and say whether this idea feasible or not?</div><div>In this case, it would be easy to fetch max value from ‘last’ field and increment it.</div>Anyway even if this idea fails as well, lets come up with better solution.<br class=""><br class=""></div><div>PS add patches mailing list to receivers so that our conversation is available for everyone.</div><br class=""></body></html>