Post #2847216
2026-05-08 11:35 UTC
@cjwatson@mastodon.ie You can make tests based on execution time of the query. I usually not try this approch because you probably want some sintetic data so the time is not influenced by data size.
I usually prefer a simple test on how much time it take in execution, with a reasonable time limit, just to catch extreme cases.
I agree that taking a look at query plan is more deterministic, but still you can have false positive, that you need to evaluete from time to time. Seq scan can be faster than index access, it depends in data size, or result set size.
Replies (1)
-
@cjwatson@mastodon.ie 2026-05-08 11:49
@diegor I definitely don't want to use execution time testing. Our tests run in various contexts with wildly varying hardware capabilities, and this would mean a lot of noise - likely much worse for us than keeping up with changes in PostgreSQL.