Afrostream / afrostream-back-end

Simple backo for afrostream
1 stars 0 forks source link

bug: MMDM: pb generation du csv #390

Closed syndr0m closed 7 years ago

syndr0m commented 7 years ago

pb ETIMEDOUT entre afrostream-exports-osearch et le backend sur un call d'api orange qui parcourt Logs

=> problème performance sur la table Logs (comme Nelson)

CREATE INDEX CONCURRENTLY "Logs_createdAt_idx"
ON "Logs" ("createdAt" ASC NULLS LAST);
explain analyse 
select count(*) from "Logs"
where 
 type='read-video'
 AND ("createdAt" > '2016-01-01 00:00:00' AND "createdAt" < '2016-01-02 00:00:00')

scan durait 18 sec, il dure maintenant 1.6 sec

"Aggregate (cost=279.67..279.67 rows=1 width=0) (actual time=1.577..1.577 rows=1 loops=1)"
" -> Index Scan using "Logs_createdAt_idx" on "Logs" (cost=0.09..278.59 rows=2145 width=0) (actual time=1.576..1.576 rows=0 loops=1)"
" Index Cond: (("createdAt" > '2016-01-01 00:00:00+00'::timestamp with time zone) AND ("createdAt" < '2016-01-02 00:00:00+00'::timestamp with time zone))"
" Filter: ((type)::text = 'read-video'::text)"
" Rows Removed by Filter: 4628"
"Planning time: 0.216 ms"
"Execution time: 1.603 ms"
syndr0m commented 7 years ago

done