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

perf: replace SELECT * with specific columns in SQL queries #3214

Merged
merged 4 commits into from
Jan 5, 2025

Conversation

dudantas
Copy link
Member

@dudantas dudantas commented Jan 4, 2025

Description

This PR replaces all occurrences of SELECT * in SQL queries with explicit column names. The use of SELECT * often retrieves unnecessary data, increasing query processing time and bandwidth usage. By specifying the required columns, this change improves performance and reduces resource usage.


Behaviour

Actual

  • SQL queries retrieve all columns using SELECT *, even when only a subset of columns is required, leading to unnecessary data retrieval and inefficiency.

Expected

  • SQL queries specify the needed columns explicitly, improving query performance and reducing resource usage.

Type of change

  • Performance improvement (non-breaking change)

How Has This Been Tested

  • Validated that all updated queries return the correct and expected data.
  • Benchmarked updated queries to confirm performance improvements.
  • Tested all affected code paths to ensure no functionality is broken.

Checklist

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I checked the PR checks reports.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.

dudantas and others added 2 commits January 4, 2025 01:06
Replaced `SELECT *` in SQL queries with explicit column names. This improves query performance by reducing unnecessary data retrieval and ensures better clarity and maintainability in the codebase.
Copy link
Contributor

@FelipePaluco FelipePaluco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excelente Job, in fact a good refactor.

Copy link

sonarqubecloud bot commented Jan 5, 2025

@majestyotbr majestyotbr merged commit cc3a246 into main Jan 5, 2025
2 checks passed
@majestyotbr majestyotbr deleted the dudantas/remove-from-some-sql-querys branch January 5, 2025 15:51
vllworldbuilding pushed a commit to vllworldbuilding/canary that referenced this pull request Jan 10, 2025
…abr#3214)

This replaces all occurrences of `SELECT *` in SQL queries with
explicit column names. The use of `SELECT *` often retrieves unnecessary
data, increasing query processing time and bandwidth usage. By
specifying the required columns, this change improves performance and
reduces resource usage.
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

Successfully merging this pull request may close these issues.

5 participants