Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/mvnw text eol=lf
*.cmd text eol=crlf
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
HELP.md
target/
.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### VS Code ###
.vscode/
3 changes: 3 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
wrapperVersion=3.3.4
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.16/apache-maven-3.9.16-bin.zip
Comment on lines +1 to +3

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

props=".mvn/wrapper/maven-wrapper.properties"

echo "Checking for distributionSha256Sum..."
if awk -F= '$1=="distributionSha256Sum"{found=1} END{exit !found}' "$props"; then
  echo "distributionSha256Sum is present"
else
  echo "distributionSha256Sum is missing"
fi

url="$(awk -F= '$1=="distributionUrl"{print $2}' "$props")"
echo "distributionUrl=$url"

echo "Expected SHA-256 from repository:"
curl -fsSL "${url}.sha256"

Repository: KaranSinghG/sql-latency-optimization-demo

Length of output: 376


🌐 Web query:

Apache Maven 3.9.16 SHA-256 checksum distribution source

💡 Result:

The official distribution of Apache Maven 3.9.16 provides SHA-512 checksum files, not SHA-256 checksum files [1][2]. You can verify the integrity of your download using the provided.sha512 files located in the binaries and source directories on the official Apache distribution server [1][3][2]. For each distribution archive, the corresponding.sha512 file is available at the same location [1][2]: - Binary (tar.gz): apache-maven-3.9.16-bin.tar.gz.sha512 [1][2] - Binary (zip): apache-maven-3.9.16-bin.zip.sha512 [1][2] - Source (tar.gz): apache-maven-3.9.16-src.tar.gz.sha512 [3] - Source (zip): apache-maven-3.9.16-src.zip.sha512 [3] While Apache documentation indicates that SHA-256 hashes can be generated manually using tools like gpg or certUtil if needed [4], the project distributes SHA-512 hashes as the standard for verifying these release bundles [1][2]. You should always download these files from the official Apache Maven download location to ensure integrity [5][4].

Citations:


🏁 Script executed:

#!/bin/bash
# Check if Maven publishes checksums in alternate locations
# Try Apache Maven dist folder
echo "Checking Apache Maven dist folder..."
curl -fsSL "https://archive.apache.org/dist/maven/maven-3/3.9.16/apache-maven-3.9.16-bin.zip.sha256" 2>&1 | head -20

Repository: KaranSinghG/sql-latency-optimization-demo

Length of output: 171


🌐 Web query:

Maven wrapper configuration distributionSha512Sum property supported

💡 Result:

Yes, the distributionSha512Sum property is supported in Maven Wrapper. It was introduced to address the need for SHA-512 verification, as the Apache Maven project primarily publishes SHA-512 checksums for its distributions [1][2][3]. The property can be added to the maven-wrapper.properties file to verify the integrity of the downloaded Maven distribution [1]. Alongside it, a corresponding wrapperSha512Sum property was also introduced to allow verification of the maven-wrapper.jar file itself [1][3]. These properties were added to provide a more practical alternative to the SHA-256 checksums, which are still supported for backward compatibility but are not always readily published by the Maven project [1][4][3].

Citations:


🏁 Script executed:

#!/bin/bash
# Fetch the actual SHA-512 checksum from official Apache Maven repository
echo "Fetching SHA-512 checksum from Apache Maven dist..."
curl -fsSL "https://downloads.apache.org/maven/maven-3/3.9.16/binaries/apache-maven-3.9.16-bin.zip.sha512"

echo ""
echo "Checking if wrapper supports distributionSha512Sum..."
grep -r "distributionSha512Sum\|distributionSha256Sum" . 2>/dev/null || echo "No references found in repo"

Repository: KaranSinghG/sql-latency-optimization-demo

Length of output: 1945


🌐 Web query:

Maven wrapper version 3.3.4 changelog SHA-512 support release date

💡 Result:

Apache Maven Wrapper version 3.3.4 was released on September 8, 2025 [1]. While the 3.3.4 release primarily served as a "quickfix" release to revert an unwanted commit from the previous version [2][3], the addition of SHA-512 checksum support was introduced via pull request #398 [4], which was integrated into the Apache Maven Wrapper codebase. This feature allows users to utilize distributionSha512Sum and wrapperSha512Sum properties in their maven-wrapper.properties file for integrity verification [4][5]. Key details regarding SHA-512 support: - Purpose: It was implemented because the Apache Maven project officially publishes SHA-512 checksums for its distributions, making them more accessible than the previously required SHA-256 sums [4][6]. - Functionality: The wrapper scripts (shell and PowerShell) and the Java runtime were updated to validate downloaded artifacts using these new SHA-512 properties, while maintaining backward compatibility with SHA-256 [4][5]. - Documentation: Checksum verification instructions are available on the official Apache Maven Wrapper tools site [7][4].

Citations:


🏁 Script executed:

#!/bin/bash
# Check wrapper version history and when SHA-512 was introduced
echo "Checking Maven wrapper GitHub for version 3.3.4 and SHA-512 support..."
curl -fsSL "https://api.github.com/repos/apache/maven-wrapper/releases" | jq '.[] | select(.tag_name | contains("3.3")) | {tag_name, published_at}' | head -40

Repository: KaranSinghG/sql-latency-optimization-demo

Length of output: 566


🏁 Script executed:

#!/bin/bash
# Check if maven-wrapper files were properly updated for version 3.3.4
echo "Checking maven-wrapper.jar version..."
ls -lh .mvn/wrapper/maven-wrapper.jar 2>/dev/null || echo "No jar found"

echo ""
echo "Checking if mvnw script references SHA-512..."
grep -c "distributionSha512Sum" ./mvnw 2>/dev/null || echo "distributionSha512Sum not found in mvnw"

echo ""
echo "Comparing with official Maven wrapper..."
# Check what the official wrapper generates
curl -fsSL "https://raw.githubusercontent.com/apache/maven-wrapper/master/mvnw" | grep -c "distributionSha512Sum" || echo "Official master branch check"

Repository: KaranSinghG/sql-latency-optimization-demo

Length of output: 365


Update Maven distribution checksum for integrity verification, but note that Maven 3.9.16 requires SHA-512.

The wrapper is missing distributionSha256Sum, disabling integrity checks. However, Apache Maven 3.9.16 only publishes SHA-512 checksums (not SHA-256), so ${distributionUrl}.sha256 does not exist.

Two options to fix this:

  1. Use SHA-512 (preferred): Update wrapper scripts to support distributionSha512Sum and add: distributionSha512Sum=ed41650d42485cfc243fad22158caf9cbb5dc408ce7a09ddb94dd42a019de929ca43065bfa450612cf12bf78b5cafa3884b96c090de326ff590448c933454af3
  2. Use an older Maven version that publishes SHA-256 checksums if SHA-512 support cannot be added.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.mvn/wrapper/maven-wrapper.properties around lines 1 - 3, The
maven-wrapper.properties file is missing a checksum property for integrity
verification. Since Maven 3.9.16 only publishes SHA-512 checksums and not
SHA-256, add the distributionSha512Sum property with the provided checksum value
to the file. Additionally, update the Maven wrapper scripts (typically in the
.mvn/wrapper directory) to support SHA-512 verification instead of SHA-256 to
ensure the integrity check functions properly with the new checksum type.

12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
A practical deep-dive into identifying and resolving database bottlenecks,
specifically the N+1 query problem and missing indexes in Spring Data JPA.

## 📊 Performance Baseline (Unoptimized)
## Performance Baseline (Unoptimized-Data-small)
- **Data Volume:** 1,000 Customers, 20,000 Orders
- **Endpoint:** `/api/customers/report`
- **Endpoint:** `/api/orders/all`
- **Total DB Queries Executed:** 1,001
- **Average Response Time:**
- **Average Response Time:** 83 ms (10 calls)

## Performance Baseline (Unoptimized-Data-large)
- **Data Volume:** 10,000 Customers, 2,000,000 Orders
- **Endpoint:** `/api/orders/all`
- **Total DB Queries Executed:** 1,001
- **Average Response Time:** 7.06 s (10 calls)
295 changes: 295 additions & 0 deletions mvnw

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading