• हिन्दीEnglishमराठीবাংলাதமிழ்മലയാളംગુજરાતીతెలుగుಕನ್ನಡଓଡ଼ିଶାZ BharatPHHBusinessWION
  • facebookyoutubetwitterwhatsapp
Zee News English
  • news
  • Live Blog
  • photos
Add Zee Business As A Preferred Source
App
  • Live TV
  • Latest News
  • India
  • World
  • Entertainment
  • Sports
  • Business
  • Lifestyle
  • Astrology
  • Auto
  • Education
  • Technology
  • News
  • /Consumer Connect
  • /Man behind AI tool for rewriting SQL Code for just $0.000173 per query

Man behind AI tool for rewriting SQL Code for just $0.000173 per query

When it comes to cloud costs, a single flawed query could cost a fintech company thousands of dollars. This problem has been solved by an American data engineer, whose solution aims to tackle the inefficiency once and for all. 

Written ByPriyanka Gupta
Published: Aug 04, 2026, 11:14 IST|Updated: Aug 04, 2026, 12:03 IST
joinshare
Man behind AI tool for rewriting SQL Code for just $0.000173 per query

About the Author

    Priyanka Gupta

    Priyanka Gupta

    A versatile content writer and brand storyteller. She crafts compelling, insightful, and audience-focused content for brands across diverse industries. Working with clients brought in by the sales team, she transforms brand objectives into clear, engaging narratives that reflect each brand’s unique voice, strengthen its identity, and communicate its value effectively. Her approach blends creativity, strategic thinking, and adaptability to deliver impactful content that resonates with audiences and drives meaningful engagement.
    Read More

    Trending

    • News
    • Photos
    'Regretfully, Yes': Nvidia CEO Jensen Huang acknowledges chip smuggling

    'Regretfully, Yes': Nvidia CEO Jensen Huang acknowledges chip smuggling

    2

    BCCI unhappy with Gautam Gambhir's outburst: 'Absolutely no need to speak like this'

    3

    Opinion | Decoding Uttar Pradesh's Economic Signals: What the 31% Surge Reveals About Consumption, Tax Formalization and GST 2.0

    4

    'Every match is going to be very important': Smriti Mandhana on playing Women's Champions Trophy at home

    5

    'Samajwadi wants to divide UP': PM Modi attacks Akhilesh Yadav's party ahead of Assembly elections

    logo
    • contact us
    • privacy policy
    • legal
    • investor info
    • advertise with us
    © 1998-2026 Indiadotcom Digital Private Limited, All Rights Reserved.

    It has become conventional practice for database engineers to use static analyzers to detect problematic SQL code. However, the problem with these software applications is that they usually treat coding tricks used intentionally as bugs while neglecting costly programming mistakes completely. This was enough for Shouvik Sharma to decide to do something more efficient. As a data engineer who worked at several fintech companies like Chime Financial and Avant and having his master's degrees in computer science and mathematics from Illinois Institute of Technology, he decided to create something that would not just lint SQL code but understand it. The result of Shouvik's efforts is a proprietary framework which combines static parsing with large language models. During its testing period, it had 0.0% false-positive rates. 

    Inefficient queries are costly 

    "The economics of poor SQL are ruthless," says Sharma. For any company that works on the cloud at scale, even something trivial like an unindexed database or a badly structured function ends up costing them real dollars. Traditional methods depend on pre-defined rules to identify errors, but while they do manage to detect the syntactic errors, they fail to capture the semantic ones. A CROSS JOIN could even be mistakenly flagged by such a tool despite being written purposefully that way. Such rigid tools also come with a penalty. The false positive rate for rule-based tools is 6.2%, estimates Sharma, resulting in wasted time spent trying to fix problems that never existed. This method views SQL more from a logical reasoning angle than mere code analysis. 

    How the system works 

    The system operates in two stages. The first stage is a static analysis using a Python-based analyzer that parses the query and detects the easy-to-find problems with high certainty. The output from this analysis is provided to a specially trained LLM, which tries to detect problems that would be hard to detect in a traditional rule-based analysis, such as some string function that makes an index unusable, and proposes a rewrite. 

    Since LLM can hallucinate and hallucination is not acceptable for production-level data layer, every rewrite proposed by AI goes through verification. The query is run in an in-memory DuckDB instance, and its number of rows and checksum is compared to the same properties of the rewritten query. If they do not match, the rewrite is not accepted. 

    Benchmarked results, according to Sharma's numbers: 

    • False positive: 0.0%, compared to 6.2% of standard approaches 
    • Accuracy of detection: 96.9% (31 out of 32 queries were correctly classified) in core dataset 
    •  On 64-query extended stress test accuracy remained at 95.3% 
    • Rewrite equivalence: 93.3% (14 of 15 rewrites checked using DuckDB checksums) 
    •  Cost per query: $0.000173 

    Also, the system was able to detect such "silent killers" as missing GROUP BY columns or non-optimal use of UNION clauses, which regular regex-based approaches often fail to do. 

    Background 

    Sharma's journey to his current achievements goes through actual production systems. At Chime Financial, he worked on building pipelines for millions of customers and built Apache Iceberg-based lakehouse infrastructure along with transaction models that work in real-time. At Avant, he designed orchestration layers which had to operate within strict requirements for predictable querying. All of his experience involves working on large-scale data infrastructure, cloud analytics, and increasingly popular AI-based systems. 

    His educational credentials are based on two domains which contribute to the development of such solutions. Sharma received his Master of Science in Computer Science and Mathematics from Illinois Institute of Technology in Chicago, as well as a prior Master of Science in Statistics from NMIMS University, located in Mumbai. It was his combined knowledge of statistics modeling on one hand, and data engineering and machine learning on the other hand, which enabled him to create risk-scoring models for the proposed framework. 

    What's Next 

    From the database administrator’s perspective, it couldn’t be simpler: less need to manually sift through inefficient queries. The software makes clear in simple terms why a particular query is underperforming, and how to fix it, a significant feature for FinOps teams balancing zero costs per query against tangible savings that can be identified before a problem reaches a database like Snowflake. 

    For Sharma, his next step is taking the software from making suggestions approved by humans to full automation of SQL optimization and rollback guarantees, basically having a bot residing within the developer’s pipeline that performs analysis, rewriting and validation of any changes to SQL, and predicts the savings for the month before anything even gets to merge. 

    Quite a lofty goal for an industry plagued by technical debt and uncontrolled cloud spend. 

    Stay informed on all the latest news, real-time breaking news updates, and follow all the important headlines in india news and world news on Zee News English.

    Add Zee News as a Preferred Source