Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3F70110EF5 for ; Wed, 2 Oct 2013 13:38:31 +0000 (UTC) Received: (qmail 85183 invoked by uid 500); 2 Oct 2013 13:38:31 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 85173 invoked by uid 500); 2 Oct 2013 13:38:30 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 85162 invoked by uid 99); 2 Oct 2013 13:38:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Oct 2013 13:38:29 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rick.hillegas@oracle.com designates 156.151.31.81 as permitted sender) Received: from [156.151.31.81] (HELO userp1040.oracle.com) (156.151.31.81) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Oct 2013 13:38:22 +0000 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r92Dc1cd002903 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 2 Oct 2013 13:38:01 GMT Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r92Dc0g1010040 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 2 Oct 2013 13:38:00 GMT Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60]) by userz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r92Dc0pi003842 for ; Wed, 2 Oct 2013 13:38:00 GMT Received: from dhcp-whq-twvpn-1-vpnpool-10-159-146-53.vpn.oracle.com (/10.159.146.53) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 02 Oct 2013 06:38:00 -0700 Message-ID: <524C21BA.1090305@oracle.com> Date: Wed, 02 Oct 2013 06:38:02 -0700 From: Rick Hillegas User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.7; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: derby-dev@db.apache.org Subject: Re: Store api question: how to ask for RowLocations References: <524B0663.5040707@oracle.com> <524B4F73.7010005@gmail.com> In-Reply-To: <524B4F73.7010005@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-Virus-Checked: Checked by ClamAV on apache.org On 10/1/13 3:40 PM, mike matrigali wrote: > In general fetchLocation is available for "normal" scans, but obviously > not available for when store returns bulk set of rows back in the form > of a hash table. also GroupFetchScanController have special interfaces > to return the RowLocation. > > Is your problem specific to hash table returns, or are there other cases > where fetchLocation from a ScanController does not work? Right now the problem is specific to hash tables. I don't know of any other cases which aren't handled by ScanController. However, this feature has tripped across a lot of surprises already so the new api may be needed elsewhere before I'm done. Can't say yet. Thanks, -Rick > > On 10/1/2013 10:29 AM, Rick Hillegas wrote: >> I need some advice about how to design an api for requesting that the >> Store include RowLocations in the rows that it scans and hands back to >> the language layer. >> >> The immediate problem that I'm working on involves implementing the >> MERGE statement (DERBY-3155). Part of the implementation involves >> cooking up a left join between two tables. I need to get back >> RowLocations for the right table of that join. In a particular problem >> case which I'm examining, the optimizer picks a HashJoin strategy for >> the left join. That turns into a HashLeftOuterJoinResultSet at execution >> time. And that, in turn, involves having the Store create and fill a >> BackingStoreHashTableFromScan. >> >> The BackingStoreHashTableFromScan is created with a scanColumnList (a >> FormatableBitSet) which specifies some actual columns in the row as well >> as a trailing column position which is meant to represent the >> RowLocation. That trailing column position is represented as 1 plus the >> actual row length. BackingStoreHashTableFromScan doesn't know what to >> make of that column position and silently ignores it. So clearly either >> that's the wrong api for asking for RowLocations or >> BackingStoreHashTableFromScan needs to be taught some new tricks. >> >> So the question is this: what's the right way to ask >> BackingStoreHashTableFromScan to build a hash table whose rows contain >> some set of real column positions plus a trailing RowLocation column? I >> may stumble into other situations where I need to ask a scan to put >> RowLocations into the rows it returns. So it would be good to have a >> general pattern here for requesting this special column. >> >> Thanks, >> -Rick >> >> > >