Have you tried this: SELECT DATA_SUMMARY.*, DVIEW.DATA2, DVIEW.DATA3 FROM DATA_SUMMARY LEFT JOIN ( SELECT DISTINCT DATA_VIEW.* FROM DATA_VIEW ) DVIEW ON DVIEW.CON_ID_2 = DATA_SUMMARY.CON_ID_1
I Can't generate thousand of data yet, but if you please try the query. In the plan, i see it should be fast PLAN JOIN (DATA_SUMMARY NATURAL, SORT (DVIEW DATA_VIEW INDEX (IDX_DATA_VIEW))) I have only primary key on the DATA_SUMMARY.CON_ID_1 and an index (not primary key) on DATA_VIEW.CON_ID_2 On Mon, Sep 16, 2013 at 8:17 PM, Norbert < norbert.saint-geor...@sixsigmagreen.eu> wrote: > Andrzej Grzegorczyk a émis l'idée suivante : > > It is view. > > > this may be the source of the slowness you describe, it is not normal > for so can record. > > -- > .. > TetraSys > > http://www.tetrasys.eu > > > > > > ------------------------------------ > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > Visit http://www.firebirdsql.org and click the Resources item > on the main (top) menu. Try Knowledgebase and FAQ links ! > > Also search the knowledgebases at http://www.ibphoenix.com > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > Yahoo! Groups Links > > > > -- Iwan Cahyadi Sugeng Interaktif Cipta Lestari