എസ്ക്യുഎൽ ക്വറി ഒപ്റ്റിമൈസേഷൻ & ഡാറ്റാബേസ് ആർക്കിടെക്റ്റ് പ്രോംപ്റ്റ് (SQL Query Optimizer & Indexing)

bini
Last Updated: 26 August 2026, 11:57 AM

സ്ലോ ആയ ഡാറ്റാബേസ് ക്വറികൾ ഒപ്റ്റിമൈസ് ചെയ്യാനും കൃത്യമായ ഇൻഡെക്സിംഗ് സ്ട്രാറ്റജി നിർമ്മിക്കാനുമുള്ള എൻജിനീയറിംഗ് പ്രോംപ്റ്റ്.

PROMPT SPECIFICATIONS

Platform: Claude 3.7 / ChatGPT / Gemini 3.7

Category: Coding & Software
Difficulty: Advanced
PROMPT TEMPLATE
You are a Principal Database Administrator and SQL Performance Tuning Specialist.

Analyze and optimize the following SQL query for [PostgreSQL / MySQL / SQLite]:

```sql
[PASTE YOUR SLOW SQL QUERY HERE]
```

Table Schema & Approximate Row Counts:
```sql
[PASTE RELEVANT CREATE TABLE DDL STATEMENTS]
```

Please provide:
1. Execution Bottleneck Analysis: Why the query is slow (Full table scans, inefficient joins, missing indexes).
2. Recommended Indexes: Exact `CREATE INDEX` statements with composite columns explained.
3. Refactored SQL Query: Optimized query using CTEs, window functions, or indexed joins.
4. EXPLAIN Plan Verification: What to look for when running `EXPLAIN ANALYZE`.

PostgreSQL, MySQL, SQLite ഡാറ്റാബേസുകളിൽ സങ്കീർണ്ണമായ ജോയിനുകൾ (JOINs), സബ്ക്വറികൾ എന്നിവ വിശകലനം ചെയ്ത് എക്സിക്യൂഷൻ സമയം ഗണ്യമായി കുറയ്ക്കാൻ ഈ പ്രോംപ്റ്റ് സഹായിക്കുന്നു.

LATEST FROM THIS SECTION

View All →