Topic on Talk:Quarry

132.73.198.144 (talkcontribs)

Hey guys,

Is there a way to know the number of entries/rows of a table stright away without running a count(*) query?

Right now I'm trying to understand the size of templatelinks but could be relevant for any other table.

Thanks in advance!

Bsdla (talkcontribs)

Can anybody please help? any clue? I'm sure the table size is mentioned somewhere.

Thanks

Milimetric (WMF) (talkcontribs)

The database engine keeps track of estimated table sizes but you can't access those through Quarry because the information is in the system database. Giving access to the system database is not a great idea, so select count(*) is about the only way you can see the size of the table.

Halfak (WMF) (talkcontribs)

You can do something to get the count more quickly. If you run a query like this: https://quarry.wmflabs.org/query/23874

SELECT COUNT(*) FROM revision;

And then click on "Explain" while the query executes, you'll see that the query engine predicts that it will need to scan 716678936 rows -- which is a good approximation of how tall the table is.

Bsdla (talkcontribs)

Thank you both.

Halfak, I'll try that.