[firebird-support] Re: performance of subselect with group by

2014-12-18 Thread Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]
>Hello, > > thanks Set, makes my test unnecessary! > > But I'm thinking a little bit about my original problem. > > Would it make sense to add a tracker entry for optimization of > subselects without reference to outer query? > > I think that they should get evaluated and transformed to someth

Re: [firebird-support] Re: performance of subselect with group by

2014-12-18 Thread Björn Reimer bjoern.rei...@fau.de [firebird-support]
Hello, thanks Set, makes my test unnecessary! But I'm thinking a little bit about my original problem. Would it make sense to add a tracker entry for optimization of subselects without reference to outer query? I think that they should get evaluated and transformed to something lik

Re: [firebird-support] Re: performance of subselect with group by

2014-12-16 Thread 'Walter R. Ojeda Valiente' sistemas2000profesio...@gmail.com [firebird-support]
Well done Set Greetings. Walter. On Tue, Dec 16, 2014 at 4:30 PM, Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support] < firebird-support@yahoogroups.com> wrote: > > > > >> I don't think there is any simple way to make a delete with a > >> subselect as the only part of

[firebird-support] Re: performance of subselect with group by

2014-12-16 Thread Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]
>> I don't think there is any simple way to make a delete with a >> subselect as the only part of a where clause perform great on >> largish tables. That is, using EXECUTE BLOCK (which doesn't exist on >> older Firebird versions) should perform OK: >> >> execute block as >>declare variable id

Re: [firebird-support] Re: performance of subselect with group by

2014-12-16 Thread Björn Reimer bjoern.rei...@fau.de [firebird-support]
Hello, well, that's not the answer I wanted to get, but I've to deal with that fact. I've to check wether EXECUTE STATEMENT can execute EXECUTE BLOCKs, as the DELETE Statement is build dynamically in a proc. > > Hi Björn! > > I don't think there is any simple way to make a dele

[firebird-support] Re: performance of subselect with group by

2014-12-16 Thread Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]
>Hello, > > Thanks for the answer. > How can I optimize if I want to use a DML command in conjunction > with a subselect, e.g. > > delete from test where Id in ( > select min(t.Id) FROM test t > group by t.reference, t.key > having count(*) > 1 > ) > Hi Björn! I don't think there is any simpl

Re: [firebird-support] Re: performance of subselect with group by

2014-12-16 Thread bjoern.rei...@fau.de [firebird-support]
Hello, Thanks for the answer. How can I optimize if I want to use a DML command in conjunction with a subselect, e.g. delete from test where Id in ( select min(t.Id) FROM test t group by t.reference, t.key having count(*) > 1 ) am Dienstag, 16. Dezember 2014 um 08:27 schrieben Sie:

[firebird-support] Re: performance of subselect with group by

2014-12-15 Thread Dmitry Yemanov dim...@users.sourceforge.net [firebird-support]
15.12.2014 23:27, bjoern.rei...@fau.de wrote: > > select min(t.Id) FROM test t > group by t.reference, t.key > having count(*) > 1 > > costs 1000 Non indexed reads > > select * from test where Id in ( > select min(t.Id) FROM test t > group by t.reference, t.key > having count(*) > 1 > ) > > costs 1