For some reason I think query2 would be faster, but it´s just a gut thought. Can´t base it on anything, not even experience.

And I think your first query doesn´t include first day of month at the moment.


Kenneth

start_date = datetime(year=show_year, month=show_month, day=1, hour=0,
minute=0, second=0)
     if show_month == 12:
         end_date = datetime(year=show_year+1, month=1, day=1, hour=0,
minute=0, second=0)
     else:
         end_date = datetime(year=show_year, month=show_month+1, day=1,
hour=0, minute=0, second=0)

There are two same queries:

datequery1 = (db.indications.date>  start_date)&(db.indications.date<
end_date)
datequery2 =
(db.indications.date.year()==show_year)&(db.indications.date.month()==show_month)

I think, the first is faster. Am I right?

Reply via email to