Subject Re: [firebird-support] Re: left join / first row select
Author Iwan Cahyadi Sugeng
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-georges@...> 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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    firebird-support-digest@yahoogroups.com
    firebird-support-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    firebird-support-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://info.yahoo.com/legal/us/yahoo/utos/terms/




--
Iwan Cahyadi Sugeng
Interaktif Cipta Lestari