Hi,

----- On 13 Nov, 2014, at 10:56, Ryan Schmidt [email protected] wrote:

> That definitely helped. Now deactivate takes 12 seconds, activate takes 19
> seconds.

OK, so one of the queries we do during activation uses a suboptimal query plan,
possibly because it uses an index that isn't very useful for the query. The
analyze command gathers statistical data on indices which is used by the query
planner to choose a better execution plan.

Maybe that's the reason why I can no longer reproduce the problem.

Can you run and provide the output of:

DROP TABLE sqlite_stat1;
EXPLAIN QUERY PLAN SELECT id FROM files WHERE actual_path=? AND active;
EXPLAIN QUERY PLAN UPDATE files SET actual_path=?, active=1 WHERE path=? AND 
id=?;
ANALYZE;
SELECT * FROM sqlite_stat1;
EXPLAIN QUERY PLAN SELECT id FROM files WHERE actual_path=? AND active;
EXPLAIN QUERY PLAN UPDATE files SET actual_path=?, active=1 WHERE path=? AND 
id=?;

-- 
Clemens Lang
_______________________________________________
macports-dev mailing list
[email protected]
https://lists.macosforge.org/mailman/listinfo/macports-dev

Reply via email to