| >dbSendQuery(con, "CREATE INDEX year ON yrpc (year)") >dbSendQuery(con, "CREATE INDEX reporter_iso ON yrpc (reporter_iso)") would sqlite use these for the query given? it seems they wouldn't help with grouping, and the grouping seems antagonistic to filtering. if you're trying for performance, you can avoid having the query engine refer back to the original table during processing by using a covering index that includes the data fields in addition to the query fields "CREATE INDEX covering (reporter_iso, year, trade_value_usd_exp, trade_value_usd_imp)" or maybe even something like "CREATE INDEX covering (reporter_iso, year, reporter_iso, trade_value_usd_exp, trade_value_usd_imp)" Though I'm not sure how it's query planner would do with a duplicate column in the index. |