PostgreSQL query optimization
EXPLAIN ANALYZE, index strategy, materialized views.
Tutor Profile
MS Computer Science from BITS Pilani. Specializes in PostgreSQL query optimization and SQL window functions and CTEs.
About the Tutor
Priya did her CS masters at BITS Pilani with a thesis on query optimization in PostgreSQL. Before that she shipped production web applications for five years across a Django backend, a Node.js services layer, and a React frontend that together moved real user traffic. The combination matters for tutoring. Most web-and-database assignments fail because the student understands one tier and treats the others as opaque; she works comfortably across all three and shows students the seams. 750+ CSHH assignments later, her sessions still feel like a code walkthrough from a senior teammate rather than a lecture.
Her favorite class of bug is the slow query. A student arrives with a Django view that returns the right data but takes 8 seconds. Priya opens the Django Debug Toolbar, sees 47 SQL queries fired for a single page render, and walks the student through the N+1 pattern that select_related and prefetch_related were designed to solve. The fix is usually three character changes. The lesson, that the ORM is hiding work the database actually has to do, takes longer and is the part students remember. Specific case from this semester: a CS186 project where a 14-table join was rewritten as a materialized view, dropping page render from 12 seconds to 200ms. The student kept the EXPLAIN ANALYZE output as a reference for their final.
On the JavaScript side her teaching priority is the event loop. Async control flow breaks more student code than any other single mechanism, and most curricula introduce promises and async/await without grounding either in the underlying queue model. Priya draws the call stack, the microtask queue, and the macrotask queue on the same page. Then she walks through a setTimeout(0) versus a Promise.resolve().then() example and asks the student to predict the print order. Students who get this right once usually do not write another race condition they cannot reason about. The diagram is on the whiteboard for the rest of the session.
A representative database optimization she documented for a returning student. The query was a customer-orders join in PostgreSQL filtering by date range, used to power a billing dashboard. The original plan did a sequential scan on a 4M-row orders table because the date column was wrapped in a function call inside the WHERE clause (date_trunc(order_date) BETWEEN ...), which defeated the existing btree index. The fix was to rewrite the predicate as order_date >= start AND order_date < end, which the planner could use the index for. Query time went from 4.2 seconds to 12 milliseconds. The student took the EXPLAIN ANALYZE comparison to their database course office hours and got a better grade on the final by re-explaining it.
React assignments are where students get the most surprises. The component renders, but it renders four times instead of once. Or it stops re-rendering when the parent state updates. Priya walks through the reconciler model on paper before opening the editor. Component identity, the rules of hooks, the dependency arrays that useEffect actually compares. She has a saved diagram of a setState batch and the resulting render cycle that she shares at the start of every React session; students who internalize the diagram stop fighting the framework.
Her CSHH workflow starts with the data, not the code. Whatever the brief, she pulls the schema first, runs the relevant queries by hand in psql or sqlite3 to confirm shape and cardinality, then builds the application layer on top of a verified data path. For React assignments she does the same with the component tree: sketch the prop flow on paper, identify which state lives where, then implement. A "good" student question for Priya is one that includes the schema, the failing query, and the EXPLAIN output. With those three things she can usually answer in a paragraph; without them, the first session is data archaeology.
Documented Specialties
EXPLAIN ANALYZE, index strategy, materialized views.
Priya handles sql window functions and ctes as a recurring CSHH workload, with documented patterns and reference solutions.
N+1 fixes, select_related, prefetch_related, raw SQL escape hatch.
Event loop, microtask queue, error propagation.
Priya handles react hooks and component composition as a recurring CSHH workload, with documented patterns and reference solutions.
Priya handles typescript generics and discriminated unions as a recurring CSHH workload, with documented patterns and reference solutions.
Sample Reviewed Code
A representative snippet from Priya's workflow. Pulled from the diagnostic playbook Priya runs on incoming CSHH assignments in this language.
-- BEFORE: function wraps the indexed column, planner cannot use idx_order_date.
-- Seq Scan on orders (cost=0.00..104329.00 rows=42 width=64)
SELECT customer_id, SUM(amount)
FROM orders
WHERE date_trunc('day', order_date) BETWEEN '2026-01-01' AND '2026-01-31'
GROUP BY customer_id;
-- AFTER: rewrite the predicate as a half-open range. SARGable, index-eligible.
-- Index Scan using idx_order_date on orders (cost=0.43..1247.18 rows=18432)
-- 4.2s -> 12ms on a 4M-row table.
SELECT customer_id, SUM(amount)
FROM orders
WHERE order_date >= '2026-01-01'
AND order_date < '2026-02-01'
GROUP BY customer_id;
Coverage Map
Subjects
Languages
Course Matches
CS50 introduces computational thinking across 10 weeks plus a final project, using 4 languages in sequence: Scratch (week 0), C (weeks 1 through 5), Python (weeks 6 through 7),...
10 recurring assignments covered
Get help with CS50CS61B teaches data structures and Java software engineering across 14 weeks under Josh Hug (since 2017) and Justin Yokota (recent semesters). Lectures cover lists, sets, maps,...
8 recurring assignments covered
Get help with CS61BMIT 6.006 introduces algorithms across 13 weeks with 26 lectures, 13 recitations, and 7 problem sets. The Spring 2020 redesign by Erik Demaine, Jason Ku, and Justin Solomon...
8 recurring assignments covered
Get help with 6.006FAQ
More Named Tutors
Four tutors keep public profiles. The rest of the bench stays off the public site so student-tutor matches stay confidential.
PhD CS
1,200+ assignments completed
MS CS
980+ assignments completed
Active Bench
Behind the four named profiles is a wider matching bench. Submissions auto-route by subject, language, and timezone. The public profiles cover the most-requested specializations; the rest of the roster stays unpublished so student-tutor pairings stay private.
Get matched to a tutor
Submit your assignment with Priya in mind. We will route the request to the best-fit tutor based on subject, language, and current load. Average first reply inside 30 minutes during business hours.
Submit for Priya