Tilon
Tilon
DTDrizzle Team
Created by Tilon on 2/12/2024 in #help
Raw SQL much faster (200x) than Drizzle for some queries
For some of our queries we see a huge difference in speed between executing the query with Drizzle vs. a direct raw Postgres query without Drizzle. The raw query takes between 10-20ms to return, however if we run the same query with Drizzle, then it can take up to 5000ms to return. This seems to happen for queries that involve pg_vector for some reason. Has anybody noticed this before? Does Drizzle do anything beside creating a raw SQL query and sending it to the DB that could explain this huge difference? We are using Neon as Db provider and our app is running on Cloudflare Workers. We have tried using the neon/serverless driver as well as the "pg" client (using Cloudflare Hyperdrive).
8 replies