You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the following query (generated by SQLAlchemy from python code) is dead slow for projects with large amounts of documents (and spans), like 10k+ documents. For 50k+ it never finishes and just burns Postgres CPU.
SELECT array_remove(array_agg(distinct(sourcedocument.id)), NULL) AS sdoc_ids, EXTRACT(year FROManon_2.date) AS anon_1
FROM sourcedocument JOIN (SELECTsourcedocument.idAS id, sourcedocumentmetadata_1.date_valueASdate, array_remove(array_agg(distinct(code.id)), NULL) AS"TA_CODE_ID_LIST"FROM sourcedocument JOIN sourcedocumentmetadata AS sourcedocumentmetadata_1 ONsourcedocument.id=sourcedocumentmetadata_1.source_document_idANDsourcedocumentmetadata_1.project_metadata_id=2234ANDsourcedocumentmetadata_1.date_valueIS NOT NULLLEFT OUTER JOIN annotationdocument ONsourcedocument.id=annotationdocument.source_document_id, spanannotation LEFT OUTER JOIN code ONcode.id=spanannotation.code_idWHEREsourcedocument.project_id=87GROUP BYsourcedocument.id, sourcedocumentmetadata_1.date_value) AS anon_2 ONsourcedocument.id=anon_2.idWHERE anon_2."TA_CODE_ID_LIST" @> ARRAY[9621]::INTEGER[] GROUP BY EXTRACT(year FROManon_2.date) ORDER BY sdoc_ids DESC
The text was updated successfully, but these errors were encountered:
the following query (generated by SQLAlchemy from python code) is dead slow for projects with large amounts of documents (and spans), like 10k+ documents. For 50k+ it never finishes and just burns Postgres CPU.
The text was updated successfully, but these errors were encountered: