[Babase] POTENTIAL_DADS view can be tested-ish

Susan Alberts alberts at duke.edu
Mon Oct 18 12:36:46 EDT 2010


Sorry, I missed some of Karl's comment yesterday. See below.

On Oct 17, 2010, at 5:22 PM, Karl O. Pinc wrote:
>
> Note that there is no preset order to the results so, in theory,
> browsing is dangerous. (As with any regular unordered table or
> other unordered views data _could_ come back in any order.)

Understood, I assume this for all tables, others do too I think.  
Thanks for reminder.
>
>>>>
>>>> It takes about a minute and a half to process.   The rest
>>>> of the time is ppa and delivering the data to the browser.
>
> I completely redid some of the structure.  I will re-send the
> query when I finish testing.  It now will likely take a lot
> longer to look at the entire view.
>
> There was a serious bug -- the potential dad had to be there
> on the zdate.

Yes, this would be a bug.
>
>>>>
>>>> Well, postgres can compute age in years based on calendar date.
>>>> I have not thought through the implications but I imagine that it
>>>> has a lot to do with whether you were born in a leap year and how
>>>> the rounding all works out.
>>>
>>> Ah I see. I think it is more important for us to be consistent
>>> across different analyses, and I have always used 365.25 for years,
>>
>>> I think Jeanne uses months which can be calculated from the days
>>> column. So my view is that we are OK on that column.
>
> Ok.  Good by me.  Note that, I think, some of the database checks
> use "real" calendar age.  I.E.  Born on the 31s?  Then the 31st
> is your birthday.  I can see possibilities for age computations
> to vary if dividing by 365.25 at the end of longer months, depending
> on when birth happens in the leap year cycle.  Maybe.  Anyway,
> a heads-up.

OK thanks.

>
>>>>
>>>>>
>>>>> One thing that should be fixed is the count of days the male was
>>>>> present in the female's five-day window. Currently we have 6
>>>>> possible
>>>>>
>>>>> days because I think you counted Z-day as well as the five days
>>>>> prior.
>>>>>
>>>>> We only want the five days prior.
>>>>
>>>> Ok.  Do you want a male to be a potential dad if they were
>>>> present on the zdate but not any of the 5 prior days?
>>>
>>> No
>
> Ok.  And we don't want MCE related counts then too.
>
> But all kid/mom group membership and age and status is still
> computed based on zdate.  Right?

Yes to both for now, but see my reply to Niki in a subsequent email.

>
>>>
>>>>
>>>>>
>>>>> Thanks for sending the query, I have not looked through it in
>> detail
>>>>> but will if you want.
>
> Eventually another pair of eyes would be good.
>
>>>>
>>>> You could.  It's a lot simpler if you base it on the maternities
>>>> and actor_actee views but that makes it run slower.  At least
>> 1/3rd
>>>> longer and probably more like twice as slow.  It may be
>>>> a false optimization to tweak it like this, more trouble in the
>>>> long run to maintain, but I've not figured that out yet.
>>>> This is the sort of syntax-ie stuff I'm thinking about.
>>>> (Note that the whole first series of joins, up until you
>>>> get to the pdad stuff, is a re-creation of maternities.)
>>>>
>>>> Any thoughts on performance?  If you ask for a particular
>>>> kid then it runs fast enough no matter how it's formulated.
>>>
>>> OK I will do some querying to test and see.
>
> Is it typical you return the entire result set or use the
> view as a table in another query?   If not then it can
> take twice as long and we don't really care.

Mostly we will query it but as we said on the phone last night, people  
will also click browse to look at it.

Susan

>
>
>
>

------------------------------------------------------------
Susan Alberts, Professor of Biology, Duke University, Box 90338,  
Durham NC 27708. Phone 919-660-7272, FAX 919-660-7293






More information about the Babase mailing list