[Babase] new tables row count_last modified

kfenn kfenn at princeton.edu
Fri Oct 19 14:24:05 EDT 2007


Thanks also for your response on this, Karl.  For the most part, the 
users tables made from queries will be static and so row counts are very 
helpful, particularly since we've lost some counting tricks I used to 
use in FoxPro.

Tabby

Karl O. Pinc wrote:
>
> On 10/18/2007 01:17:27 PM, kfenn wrote:
>> Two questions for Karl,
>>
>> Why is it that any new tables we create in the fecal schema do not 
>> have a row count?  I don't think it is just this schema, I think the 
>> undergrads noticed this problem in their own schemas as well.
>
> The row count is only an estimate used by the planner to make
> queries faster.  It is updated only when the VACUUM command is
> run (on the table or the database as a whole), either manually
> or automatically.
>
> I wasn't thinking of the user's tables.  I need to turn on
> automatic vacuuming so that queries on big tables run (much)
> faster.
>
> Note that because the database is multi-user there is
> a complex notion of how many rows are in a table.  Each
> logged-in user has his own "window" into each table,
> and sees only what they have done plus what everybody
> else has committed.  If you "select count(*) from biograph;"
> you will get, say, 700 rows.  But Lacey might already have
> started a transaction and have inserted 2 new rows.  If she
> does "select count(*) from biograph;" she will get 702 rows.
> You will only see those extra 2 rows (in any fashion) when
> she commits her transaction.  If she rolls it back, or never
> commits it, then you will never know she inserted those 2 rows.
>
>> Also, how do we tell when a table was last updated?  I used to look 
>> at the .dbf file dates in in an explorer window for Foxpro, but I'm 
>> not sure how to check the modified dates on these tables.
>
> As far as I know there is no way to tell.  (From the discussion of
> transactions above you can see why the answer might not be simple.)
>
> Karl <kop at meme.com>
> Free Software:  "You don't pay back, you pay forward."
>                  -- Robert A. Heinlein
>
> _______________________________________________
> Babase mailing list
> Babase at www.eco.princeton.edu
> http://www.eco.princeton.edu/mailman/listinfo/babase

-- 
Tabby Fenn
Research Assistant

Dept of Ecology and Evolutionary Biology
401 Guyot Hall
Princeton University
Princeton, NJ  08544

609 258-6898 (Ph)
609 258-2712 (Fx)



More information about the Babase mailing list