From user-return-11005-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Mon Dec 06 11:05:41 2010 Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 48801 invoked from network); 6 Dec 2010 11:05:41 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Dec 2010 11:05:41 -0000 Received: (qmail 7347 invoked by uid 500); 6 Dec 2010 11:05:38 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 7227 invoked by uid 500); 6 Dec 2010 11:05:38 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 7219 invoked by uid 99); 6 Dec 2010 11:05:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Dec 2010 11:05:38 +0000 X-ASF-Spam-Status: No, hits=0.3 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of sylvain@yakaz.com does not designate 209.85.216.179 as permitted sender) Received: from [209.85.216.179] (HELO mail-qy0-f179.google.com) (209.85.216.179) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Dec 2010 11:05:31 +0000 Received: by qyk11 with SMTP id 11so12620056qyk.10 for ; Mon, 06 Dec 2010 03:05:09 -0800 (PST) Received: by 10.229.91.13 with SMTP id k13mr4256229qcm.299.1291633508593; Mon, 06 Dec 2010 03:05:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.215.74 with HTTP; Mon, 6 Dec 2010 03:04:47 -0800 (PST) In-Reply-To: <1be5b6f4.12e3d.12cbb388229.Coremail.sei_wjx@126.com> References: <1d69693.3aba.12cb6bd599b.Coremail.sei_wjx@126.com> <1be5b6f4.12e3d.12cbb388229.Coremail.sei_wjx@126.com> From: Sylvain Lebresne Date: Mon, 6 Dec 2010 12:04:47 +0100 Message-ID: Subject: Re: Re: index file and KeysCached To: user@cassandra.apache.org Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable 2010/12/6 =CE=BA=BD=F0=CF=C9 : > so when will index files be in the memory? The index files are never fully in memory (because it would quickly be too big). Hence, only a sample of this file is in memory (1 every 128 entry by default). When cassandra needs to know where a (row) key is on disk (for a given SStable), it checks this sample (an offset in the index file to a block of key location), reads the block of (128) entries corresponding in the index file on disk, thus finding the actual offset in the sstable where the corresponding row start. The goal of the KeyCache is to avoid this on a cache hit (thus basically avoiding a seek). > > At 2010-12-06 00:54:48=A3=AC"Brandon Williams" wrote: > > 2010/12/5 =CE=BA=BD=F0=CF=C9 >> >> for each sstable, there is an index file, which is loaded in memory to >> locate a particular key's offset efficiently. > > Index files are not held in memory. > >> >> and for each CF, KeysCached can be set to cache keys' location. >> could you pls tell me the difference between the two? > > KeysCached are held in memory. > >> >> I'm wondering whether it's necessary to set "KeysCached" for a CF or not= . > > Not necessary, but advantageous. > -Brandon > > ________________________________ > =CD=F8=D2=D7163/126=D3=CA=CF=E4=B0=D9=B7=D6=B0=D9=BC=E6=C8=DDiphone ipad= =D3=CA=BC=FE=CA=D5=B7=A2