Sample Header Ad - 728x90

psql meta-command \d is really slow

0 votes
1 answer
102 views
My basic question is: what affects the performance of \d? I have a separate (small) schema that I manage on a database server that I have otherwise no higher privileges on. The server holds a huge (billion+ rows) database in its public schema. My separate schema provides some auxiliary information used only for webpage rendering of the data in the public schema. *Edit*: It's actually 5.5 billion+ rows, and that's just in one of the biggest tables (and only took 1.5 hours to finish the count(*)!). When I do a simple \d at the psql prompt, it is really slow - on the order of 6.5 seconds when I time it. Clearly, the database/database server has heavy load, but should I bring this \d performance to the attention of the sysadmins (who generally don't want to be bothered)? (Does it imply something markedly wrong in the system?) Everything else in my schema runs on the order of milliseconds, so it's not impacting _my_ schema's performance *per se*. Regardless of whether I bring it to their attention, what impacts the performance of \d? The public schema has 985 tables. Even so, it seems like it would be a fairly simple query; I would expect it's only looking at table names, not table contents.
Asked by Randall (385 rep)
Sep 21, 2023, 06:59 PM
Last activity: Apr 1, 2025, 07:07 PM