Topic on Talk:Quarry

Jura1 (talkcontribs)

Since a table was deleted, how does one get the page_id for a qid efficiently?

page properties doesn't seem to work well.

Matěj Suchánek (talkcontribs)
JOIN page ON page_namespace = 0 AND page_title = ...
Jura1 (talkcontribs)

Thanks. Way too easy :)

Matěj Suchánek (talkcontribs)

Perhaps I shouldn't have been so brief. wb_items_per_site still contains numbers, so you need to do either:

JOIN page ON page_namespace = 0 AND page_title = CONCAT('Q', ips_item_id)

or

JOIN wb_items_per_site ON REPLACE('Q', '', page_title) = ips_item_id

This will make the query use indexes and therefore will be fast.

Reply to "Wikidata"