Bilel Abdelmoula

Home › PostgreSQL performance

PostgreSQL · API performance

I debug slow APIs from query plan to application flow

On a production ATS/CRM with ~150k person records and ~100k companies, important APIs could take 5, 10, 30 or 40+ seconds under load. I took ownership of performance: traced each bottleneck, then fixed indexes, queries, pagination, triggers and data access to bring the product back to interactive speed.

  • Indexes, GIN, geospatial
  • Join rewrites + pagination
  • Trigger fixes
  • Remote, UTC+1

Results

Measured on real projects.

  • 5–40+ sproduction API response times under load, before
  • ~80 → 20%normal Xano CPU/memory load, before → after
  • ~150kperson records · ~100k companies
  • ~32 s → asyncCV workflow taken out of the request

How I did it

On a production ATS/CRM built at Soraia for a Spanish recruitment company.

Find the real cause first

What was actually slow

  • Missing indexes and filters PostgreSQL couldn't use.
  • Repeated database calls and N+1-like patterns; inefficient joins.
  • Heavy add-ons, looping triggers, large responses and missing pagination.
  • PostgreSQL
  • Xano

Fix it at the database

Indexes and queries

  • PostgreSQL, GIN and geospatial indexes on the columns that filters, search and distance queries actually use.
  • Replaced an is_contact boolean with an indexed type column.
  • Direct database queries and rewritten joins; some flows that ran 100+ database operations became a single consolidated query.
  • PostgreSQL
  • GIN
  • PostGIS

Fix it in the application flow

Less work per request

  • Pagination and fewer returned fields; role/access-aware responses that only send what each user may see.
  • Fixed looping triggers and moved heavy work to background tasks.
  • Redesigned a synchronous ~32-second CV workflow so OCR/AI enrichment runs after the response.
  • Pagination
  • Triggers
  • Background jobs

Clean data at scale

Imports, duplicates and migrations

  • Imports, data cleanup and deduplication; CSV imports that fill gaps without overwriting existing data.
  • Led the initial migration of contacts, opportunities and activities from Clientify into the platform.
  • Python
  • SQL
  • CSV

What I can do for your database or API

  • Find and fix slow endpoints and queries
  • Add the right indexes (B-tree, GIN, geospatial) and restructure columns
  • Rewrite joins, add pagination and trim response payloads
  • Fix triggers and move slow work to background jobs
  • Clean, deduplicate and migrate data
  • PostgreSQL, PostGIS and MySQL; Xano or plain REST APIs

FAQ

Quick answers before we talk.

How much faster can you make my API?

It depends on the cause, so I won't promise a multiplier before I've seen your queries. On a production ATS/CRM, APIs at 5–40+ seconds under load were brought back to interactive speed by fixing indexes, joins, pagination, triggers and repeated calls.

Do you work with Xano's PostgreSQL?

Yes. Most of my performance work was on Xano, which runs on PostgreSQL, including direct SQL queries. See my Xano developer page.

Can you clean up duplicate or messy data?

Yes. I've handled imports, deduplication and a CRM migration from Clientify, with mapping and cleanup.

Do you work remotely?

Yes, fully remote from Oran, Algeria (UTC+1).

How do we start?

Book a free call or email me at abdelmoulabilel2000@gmail.com with the endpoint or query that's slow.

Let's build it properly

Tell me what's slow, messy or missing. A short call is enough to see if I can help.

Also see