Brian Cox wrote:

There are 1.9M rows in ts_defects and indexes on b.ts_id (primary key)
d.ts_biz_event_id and d.ts_occur_date. Both queries below return 0 rows. The 1st runs fast and the 2nd > 400x slower. The 2nd query
differs from the 1st only by the addition of "limit 1".

Why the big difference in performance?

Please run EXPLAIN ANALYZE on both queries, and send back the results. Also, what indexes are there on the tables involved?

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

               http://www.postgresql.org/about/donate

Reply via email to