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

Use show schemas instead of selecting from information_schema.schemata on Snowflake #2166

Closed
drewbanin opened this issue Feb 27, 2020 · 1 comment · Fixed by #2171
Closed
Labels
enhancement New feature or request snowflake

Comments

@drewbanin
Copy link
Contributor

Describe the feature

Background:

Screen Shot 2020-02-27 at 1 01 30 PM
Screen Shot 2020-02-27 at 1 01 42 PM

Let's replace the call to information_schema.schemata on Snowflake with a call to show schemas in <database>.

Advantages:

  • show schemas will not queue, whereas the select statement can queue
  • show schemas does not require a running warehouse
  • show schemas appears to be strictly faster than the information_schema alternative

We should consider applying this approach for other queries, as described in #1877 (the key benefit being that these queries do not queue. Let's keep #1877 open and tackle these other queries separately. See also #2157

Disadvantages:

  • show schemas requires the database name to be cased and quoted appropriately. I actually think this is the same behavior as selecting from database.information_schema.<table>, so that might not be an issue here?
@beckjake
Copy link
Contributor

The big drawback of show schemas is that it has a 10,000 record limit, so users with 10k schemas in their database (and I assume those users do exist!) will have problems. We can either fail if there are 10k or fall back to querying information_schema.schemata. I'd really rather error out, but I understand the appeal of falling back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request snowflake
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants