Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Memory during a merge


From   wgould@stata.com (William Gould, Stata)
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Memory during a merge
Date   Fri, 03 Nov 2006 08:48:29 -0600

Fred Wolfe <fwolfe@arthritis-research.org> asked about the implementation 
of the -keep(<varlist>)- option of -merge-:

> Stata has a keep() option that limits the merging of data in the using data
> set to selected variables. My question is, Does Stata first bring all of the
> using variables into memory or does it somehow drop the non-selected using
> variables before merging.

Stata does *NOT* bring in the entire using dataset and then merge; 
it does bring in, one at a time, entire observations from the using 
dataset.  The basic loop is this 

        do until all of the using data is read 
                read *ONE* observation of the using dataset
                does it merge?
                        record the keep() variables in the appropriate 
                        observation in memory
        end


-- Bill
wgould@stata.com
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index