[Firebird-devel] Decreasing statement memory usage

2020-06-04 Thread Adriano dos Santos Fernandes
Hi! To compile a statement a lot of Nodes are allocated and they are rarely freed during compilation. Most of them lives until the statement is destroyed. With each node there is the memory manager overhead (16 bytes in release build), that exists there to make individual node deallocation possi

Re: [Firebird-devel] Odd difference for IN (..) and = ANY (..) in SELECT vs WHERE

2020-06-04 Thread Mark Rotteveel
On 03-06-2020 19:29, Adriano dos Santos Fernandes wrote: Now the main engine path for IN/ANY/ALL is ANY. ALL is early converted to NOT ANY. Exactly what logic transformation are you applying, as ALL is not equivalent to NOT ANY. Do you mean to say that for example x = ALL(..) is converted to

Re: [Firebird-devel] Odd difference for IN (..) and = ANY (..) in SELECT vs WHERE

2020-06-04 Thread Adriano dos Santos Fernandes
On 04/06/2020 14:41, Mark Rotteveel wrote: > On 03-06-2020 19:29, Adriano dos Santos Fernandes wrote: >> Now the main engine path for IN/ANY/ALL is ANY. >> >> ALL is early converted to NOT ANY. > > Exactly what logic transformation are you applying, as ALL is not > equivalent to NOT ANY. Do you mea

Re: [Firebird-devel] Odd difference for IN (..) and = ANY (..) in SELECT vs WHERE

2020-06-04 Thread Mark Rotteveel
On 04-06-2020 19:49, Adriano dos Santos Fernandes wrote: On 04/06/2020 14:41, Mark Rotteveel wrote: On 03-06-2020 19:29, Adriano dos Santos Fernandes wrote: Now the main engine path for IN/ANY/ALL is ANY. ALL is early converted to NOT ANY. Exactly what logic transformation are you applying,

Re: [Firebird-devel] Odd difference for IN (..) and = ANY (..) in SELECT vs WHERE

2020-06-04 Thread Mark Rotteveel
On 03-06-2020 19:29, Adriano dos Santos Fernandes wrote: It needs a careful review. Pull request: https://github.com/FirebirdSQL/firebird/pull/269 Out of curiosity, maybe I'm just overlooking things, but how does this handle IN with a value list? The terminology in the code suggests its exec

Re: [Firebird-devel] Odd difference for IN (..) and = ANY (..) in SELECT vs WHERE

2020-06-04 Thread Adriano dos Santos Fernandes
On 04/06/2020 15:32, Mark Rotteveel wrote: > On 03-06-2020 19:29, Adriano dos Santos Fernandes wrote: >> It needs a careful review. >> >> Pull request: https://github.com/FirebirdSQL/firebird/pull/269 > > Out of curiosity, maybe I'm just overlooking things, but how does this > handle IN with a valu

Re: [Firebird-devel] Decreasing statement memory usage

2020-06-04 Thread Vlad Khorsun
04.06.2020 20:11, Adriano dos Santos Fernandes wrote: Hi! To compile a statement a lot of Nodes are allocated and they are rarely freed during compilation. Most of them lives until the statement is destroyed. With each node there is the memory manager overhead (16 bytes in release build), that

Re: [Firebird-devel] Decreasing statement memory usage

2020-06-04 Thread Adriano dos Santos Fernandes
On 04/06/2020 16:49, Vlad Khorsun wrote: >> >> I did some tests to see how many nodes were created and how much memory >> a statement pool uses: >> >> -- 39 nodes, 31728 bytes allocated >> select * from rdb$database; >> >> -- 109 nodes, 91904 bytes allocated >> select * from rdb$database >> union