----- Original Message ----- From: Ismail Kizir To: [EMAIL PROTECTED] Sent: Monday, May 03, 2004 12:14 AM Subject: Query optimization bug
Dear Sir, My name is Ismail Kizir, from Turkey. First of all, i want to thank you for you great software. I am testing it to use on my 'newspaper archives' project. Today, i remarked a query optimization bug on sqlite. I think, you would know it. SELECT count (pubdate) AS c FROM articletbl WHERE sitekodu = 4 AND ( (pubdate='2004-05-01' AND title='publication title') or (addr='/page1' AND pubdate='2004-05-02') ) I know that is a mal-formed query, but anyway, i think the optimizer should handle it correctly. But for this form of query sqlite doesn't use indexes. pubdate is an indexed column, it is article's date of publication. When i change the query to : SELECT count (pubdate) AS c FROM articletbl WHERE sitekodu = 4 AND ( (pubdate>'2004-05-01' AND (title='publication title' OR addr='/page1') ) it optimizes correctly. I hope it may help you. Kind regards Ismail Kizir