Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconsider use of tbl_stat in notebooks. #5

Open
weaverba137 opened this issue Apr 30, 2019 · 3 comments
Open

Reconsider use of tbl_stat in notebooks. #5

weaverba137 opened this issue Apr 30, 2019 · 3 comments

Comments

@weaverba137
Copy link
Member

The tbl_stat table is meant for internal operations, but several references to it exist in these notebooks:

  • DataLabNotebookTemplate.ipynb
  • 01_GettingStartedWithDataLab/02_GettingStartedWithDataLab.ipynb
  • 03_ScienceExamples/LargeScaleStructure/LargeScaleStructureSdssLs.ipynb
  • 03_ScienceExamples/ExploringM31/M31WithPhat.ipynb
  • 04_HowTos/QueryClient/How_to_use_the_Data_Lab_QueryClient.ipynb

The table does not appear to be updated automatically, and until very recently, was not installed at all on gp04. Furthermore, the row counts are approximations. There are probably better and more "official" ways to get table sizes from pg_catalog. Additional metadata would be available in the tap_schema tables, e.g. the list of available schemas.

@weaverba137
Copy link
Member Author

@jacquesalice, this very old ticket was was ultimately based on the idea that the tbl_stat table was not being updated regularly. Do you know if that is now updated routinely?

@jacquesalice
Copy link
Member

Hi @weaverba137 it does look like tbl_stat is being regularly updated, but it doesn't look like it properly stores the row count (nrows) for Views. So for a View like sdss_dr17.specobj, it says nrows=0. Example:

query = "SELECT nrows FROM tbl_stat WHERE schema='sdss_dr17' and tbl_name='specobj'"
response = qc.query(sql=query)
print(response)
--------
nrows
0

I'm not sure if this is something @mjfitzpatrick could easily implement, or if we should just add a note in the notebooks saying that tbl_stat cannot be used to obtain information about tables stored as Views.

@mjfitzpatrick
Copy link
Member

mjfitzpatrick commented Aug 24, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants