cubicweb #1922099 test for asource column takes ages on big databases [resolved]

On startup, CW tests if asource column exists. As there's no database helper yet to get the list of all columns, the query used is:

SELECT COUNT(asource) FROM entities

This will raise an exception if the column doesn't exist. On big databases, this query takes age to perform (e.g. around 8 seconds here on a database with 15M entities), a simpler like this one would be enough:

SELECT asource FROM entities LIMIT 1
done in3.13.6
load left0.000
closed by#18a366267612 [repo] use smarter query to check asource presence on startup (closes #1922099)