Answer the question
In order to leave comments, you need to log in
How to optimize sqlite query?
Hello
There is a request (sqlite .net). It takes an unacceptably long time (more than 30 seconds), although there is only one left join and it costs limit 0.1000. The amount of data is approximately 100,000 records in each of the tables. Can you suggest how to optimize it?
select
G.lemma as lemma,
G.id as id,
group_concat(distinct G.words) as words,
case when sum(K.some_data) is not null then sum(K.some_data) else 0 end as summ,
count(K.id) as cnt,
G.status as status,
G.stop_out as stop_out,
group_concat(K.id) as spl_id,
group_concat(K.keyword) as spl_kw,
group_concat(K.some_data) as spl_data,
group_concat(K.status) as spl_status
from [source_green_groups] G
left join [source_green_keywords] K on K.sg_id = G.id
group by G.lemma
order by cnt desc
limit 0,1000
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question