As an example from my BEACON tool, I want all properties that have a formatter property, with English label. That SQL is now:
SELECT DISTINCT page_title,term_text FROM pagelinks,page,wb_terms WHERE page_namespace=120 AND substr(page_title,2)=term_entity_id and term_entity_type='property' and term_language='en' and term_type='label' and pl_from=page_id and pl_title='P1630' and pl_namespace=120 and pl_from_namespace=120 ORDER BY term_text
Note the "substr". My first attempt was "page_title=concat('Q',term_entity_id)", but that took forever.
If we indeed get a full entity ID=page title column for wb_terms, and for wb_items_per_site etc., that would at least fix the on-the-fly compute. I shall thus wait with code updates until I get the full story, and not just piece-by-piece...