[PERFORM] Re: [PERFORM] Query > 1000× slowdown after adding datetime comparison

2015-08-31 Thread David G. Johnston
On Mon, Aug 31, 2015 at 12:09 PM, twoflower wrote: > I have the following three tables: > > DOCUMENT > id (index) > documenttype > date_last_updated: timestamp(6) (indexed) > > EXTERNAL_TRANSLATION_UNIT > id (indexed) > fk_id_document (indexed) > > EXTERNAL_TRANSLATION > id (indexed)

Re: [PERFORM] Query > 1000× slowdown after adding datetime comparison

2015-08-31 Thread Tomas Vondra
On 08/31/2015 06:09 PM, twoflower wrote: I have the following three tables: ... This is the query plan: If I remove the WHERE condition, it returns immediately. Am I doing something obviously wrong? Please share explain plans for both

[PERFORM] Query > 1000× slowdown after adding datetime comparison

2015-08-31 Thread twoflower
I have the following three tables: DOCUMENT id (index) documenttype date_last_updated: timestamp(6) (indexed) EXTERNAL_TRANSLATION_UNIT id (indexed) fk_id_document (indexed) EXTERNAL_TRANSLATION id (indexed) fk_id_translation_unit (indexed) Table sizes: DOCUMENT: 381 000 EXTERNA