[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OSSTEST PATCH 14/14] duration_estimator: Move duration query loop into database


  • To: Ian Jackson <Ian.Jackson@xxxxxxxxxx>
  • From: George Dunlap <George.Dunlap@xxxxxxxxxx>
  • Date: Fri, 31 Jul 2020 10:45:35 +0000
  • Accept-language: en-GB, en-US
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 31 Jul 2020 10:45:46 +0000
  • Ironport-sdr: 8xbihE64pm+UhQNHOCjB1DgdZc7BiInihMh6xsurBN2xDsPlWjeXJsZMWtx0GUq+NxWZ5aXcAr 9kG4Bh39hGheKFh+PvPDo5YE1wLi9w50pmnuYQ3N47MY4HNqPbYSwdMWYzYa4jv/WAQYh0xHlS rzaCzhmjBqv4yYO8cAwozLnT6BDP7fvxRjRPwLRQ8tVI/etC5SgOeARheiLbBRXc1A5MGpaRDs 3BLymNRd33ZhOaZ3pKT8wOLW5XFPVxPZSOGDah2qumV7Dpbj3gy0QxRkNbz3JPAKWJp1CELqOo 1vo=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHWX5IXwUKXL54pjkKddmBXrxrv3qkbmlIAgAXSzgCAAAGlgA==
  • Thread-topic: [OSSTEST PATCH 14/14] duration_estimator: Move duration query loop into database


> On Jul 31, 2020, at 11:39 AM, Ian Jackson <ian.jackson@xxxxxxxxxx> wrote:
> 
> George Dunlap writes ("Re: [OSSTEST PATCH 14/14] duration_estimator: Move 
> duration query loop into database"):
>>> On Jul 21, 2020, at 7:42 PM, Ian Jackson <ian.jackson@xxxxxxxxxxxxx> wrote:
> ...
>>> Example queries before (from the debugging output):
>>> 
>>> Query A part I:
>>> 
>>>           SELECT f.flight AS flight,
>>>                  j.job AS job,
>>>                  f.started AS started,
>>>                  j.status AS status
>>>                    FROM flights f
>>>                    JOIN jobs j USING (flight)
>>>                    JOIN runvars r
>>>                            ON  f.flight=r.flight
>>>                           AND  r.name=?
>>>                   WHERE  j.job=r.job
>> 
>> Did these last two get mixed up?  My limited experience w/ JOIN ON
>> and WHERE would lead me to expect we’re joining on
>> `f.flight=r.flight and r.job = j.job`, and having `r.name = ?` as
>> part of the WHERE clause.  I see it’s the same in the combined query
>> as well.
> 
> Well spotted.  However, actually, this makes no difference: with an
> inner join, ON clauses are the same as WHERE clauses.  It does seem
> stylistically poor though, so I will add a commit to change it.

Yeah, in my tiny amount of experience with SQLite, putting this sort of 
restriction in WHERE rather than ON didn’t seem to make a practical difference; 
no doubt the query planner is smart enough to DTRT.  But switching them should 
make it slightly easier for humans to parse, so is probably worth doing while 
you’re here, if you have a few spare cycles.

Thanks,
 -George


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.