> Try putting a "+" symbol before "styleid". Like this: > > AND +styleid IN (1351,1362,1371,1374,1376,1542,1595,1597,1643,1762)
THATS IT !!!!!!!!!! :-))) 50ms with +, and 15000ms without the + How is that possible? Am 30.05.2017 um 17:36 schrieb Richard Hipp:
On 5/27/17, Thomas Flemming <[email protected]> wrote:Hi, I have a table Pois with points of interest (geogr. coordinate, label, styleid) where I do regional querys using a rtree-index: SELECT Pois.* FROM Pois_bb, Pois WHERE y0 < -14.8600 AND y1 > -15.12862 AND x0 < 30.46203 AND x1 > 30.00074766 AND 18 BETWEEN z0 AND z1 AND Pois_bb.Id = Pois.Id Thats very fast, 50ms. The problem is, when I add a second condition to get certain poi-types only in the area: AND styleid IN 1351,1362,1371,1374,1376,1542,1595,1597,1643,1762Try putting a "+" symbol before "styleid". Like this: AND +styleid IN (1351,1362,1371,1374,1376,1542,1595,1597,1643,1762)The query becomes really slow, 800ms. There is of course also an index on styleid. I also realized, just this query: SELECT * FROM Pois WHERE styleid IN 1351,1362,1371,1374,1376,1542,1595,1597,1643,1762 is also slow for the first call. The second call is fast. (Using SQLite Expert Professional 3.5 for testing). Any ideas, how to speed this up? Thanks Tom -- /**************************************** ** Flemming Software Development CC ** Thomas Flemming ** PO Box 81244 ** Windhoek, Namibia ** http://www.quovadis-gps.com ** mail [email protected] ** +264 (0)81 3329923 ** +49 (0)6182 8492599 ***************************************/ _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
-- /**************************************** ** Flemming Software Development CC ** Thomas Flemming ** PO Box 81244 ** Windhoek, Namibia ** http://www.quovadis-gps.com ** mail [email protected] ** +264 (0)81 3329923 ** +49 (0)6182 8492599 ***************************************/ _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

