taking more time while using where clause.

Let say we have a disk table(tinfo) with 15 columneg:id,name,address,etc., and holding millions of recordsselect from tinf – this is taking very less time and memorybutselect from tinfo where id >0 – this is taking more time and memoryAt the end of the day both query is going to output the same amount ofdata(assuming the table is not holding 0 or less).May be the second query is taking time to scan entire table.If someone can explain, what is happening on both of those query ishelpful. also suggest how to improve the performance while usingsecond query.

Date: Tue, 1 Sep 2009 12:52:04 +0200Message-ID: <47e19e0e0909010352t73989241pe739216c31dfc362@mail.gmail.com>Subject: Re: [personal kdb+] taking more time while using where clause.From: Charles Skelton To: personal-kdbplus@googlegroups.comhow did you do your timing?\t select from tinfowill be exceedingly quick, as it is only mapping the table into memorywithout touching any data.\t select from tinfo where id>0will allocate memory to accommodate the restriction of data, and copythat data from disk into memory.As you say you want to output the data, a meaningful comparison is probably\t -8!select from infoversus\t -8!select from info where id>0-8! generates the serialized data set.On Tue, Sep 1, 2009 at 12:02 PM, Naga<nagarajan.palanivelu> wrote:>> Let say we have a disk table(tinfo) with 15 column> eg:id,name,address,etc., and holding millions of records>> select from tinf ? – this is taking very less time and memory>> but>> select from tinfo where id >0 ? – this is taking more time and memory>> At the end of the day both query is going to output the same amount of> data(assuming the table is not holding 0 or less).>> May be the second query is taking time to scan entire table.>> If someone can explain, what is happening on both of those query is> helpful. also suggest how to improve the performance while using> second query.> >></nagarajan.palanivelu>