Re: [sqlite] Slow View when it is used in a where clause

2011-12-02 Thread Pavel Ivanov
> Specifically, when I said "using directly the select of the view", I mean > execute this query: > > EXPLAIN QUERY PLAN SELECT wg.*, count(DISTINCT w.idWord) AS itemsCount, > count(DISTINCT dw.Document_idDocument) AS documentsCount > > FROM WordGroup wg >    LEFT OUTER JOIN Word w ON wg.idWordGrou

Re: [sqlite] Slow View when it is used in a where clause

2011-12-02 Thread Manuel Jesus Cobo Martin
Hello Pavel, Thank you for your answer. Probably, as you have commented, the problem is that the optimizer of SQLite does not work fine in this case. Specifically, when I said "using directly the select of the view", I mean execute this query: EXPLAIN QUERY PLAN SELECT wg.*, count(DISTINCT

Re: [sqlite] Slow View when it is used in a where clause

2011-12-02 Thread Pavel Ivanov
> I have been analyzing the Query PLAN. In the query "Select * FROM > WordGroupView Where idWordGroup = 1;" the database engine perform a scan > over WordGroup table, and it is not necessary since the where clause is > defined. However, using directly the query of the view change the SCAN by a > SE