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

Add 'identity_zone_id' column to indexes for 'alias_zid' #2942

Merged
merged 6 commits into from
Jun 27, 2024

Conversation

adrianhoelzl-sap
Copy link
Contributor

No description provided.

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/187854609

The labels on this github issue will be updated when the story is started.

adrianhoelzl-sap and others added 3 commits June 26, 2024 09:17
- shorten the index name. similar name pattern then existing idexes
- changed order of index. indentity_zone_id should be always first column
- removed not null from SQL, since not needed, see https://stackoverflow.com/questions/8660203/how-to-check-for-is-not-null-and-is-not-empty-string-in-sql-server
or
https://stackoverflow.com/questions/1106258/mysql-null-vs
@strehle
Copy link
Member

strehle commented Jun 26, 2024

Refactorings

See indexes now
image

Verification done with some new zones with aliases, then

explain analyze select 1 from identity_provider idp where idp.identity_zone_id = 'uaa' and idp.alias_zid <> '' limit 1

Result on MYSQL (more info but similar to postgres)
-> Limit: 1 row(s) (cost=0.886 rows=1) (actual time=0.0163..0.0164 rows=1 loops=1)
-> Filter: ((idp.identity_zone_id = 'uaa') and (idp.alias_zid <> '')) (cost=0.886 rows=3) (actual time=0.0156..0.0156 rows=1 loops=1)
-> Covering index range scan on idp using alias_in_zone over (identity_zone_id = 'uaa' AND NULL < alias_zid < '') OR (identity_zone_id = 'uaa' AND '' < alias_zid) (cost=0.886 rows=3) (actual time=0.014..0.014 rows=1 loops=1)

Both use alias_in_zone . In postgresql I found out, that the order of columns is important

@strehle strehle requested review from hsinn0 and Tallicia June 26, 2024 09:15
@strehle strehle merged commit 0e522de into develop Jun 27, 2024
22 checks passed
@strehle strehle deleted the alias-zid-index-add-idz-id-field branch June 27, 2024 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants