Re: [Firebird-devel] isc_dpb_lc_ctype and isc_dpb_set_db_charset and isc_dpb_utf8_filename

2022-02-28 Thread Jiří Činčura
Thanks. I suppose not only TPB, but also buffers for batch, events, etc., right?

Basically only DPB and SPB are "UTF8-ready".

-- 
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/

On Mon, Feb 28, 2022, at 15:21, Alex Peshkoff via Firebird-devel wrote:
> On 2/28/22 13:38, Jiří Činčura wrote:
>> Does the isc_dpb_utf8_filename imply also UTF8 strings in TPB (i.e. for 
>> table names used with isc_tpb_lock_write, etc.)?
>>
>
> They are expected in attachment charset.
>
>
>
>
> Firebird-Devel mailing list, web interface at 
> https://lists.sourceforge.net/lists/listinfo/firebird-devel


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Compiled statement cache

2022-02-28 Thread Adriano dos Santos Fernandes
On 28/02/2022 13:18, Alex Peshkoff via Firebird-devel wrote:
> I suppose it's with mentoned 2Mb cache.

Yes. But it's the same even with 100K as the test uses very few and
small statements.


> 
> One more question. Suppose some statement remains in a cache for very
> long time cause it's reused again and again. That's fine - but with DB
> grow optimal plan can change. Is it solved somehow? Suppose in first
> implementation not,

Correct.

And it's a problem also now when application holds prepared statement
manually, but that probably is not going to be changed.


> but are there plans to solve it?
> 

I think there are two possible ways:

- Timeout of cached statement (counting from its first appearance in
cache, not last usage)

- When engine detects a condition which could change a plan, it may ask
cache for invalidation.


Adriano


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Compiled statement cache

2022-02-28 Thread Alex Peshkoff via Firebird-devel

On 2/28/22 16:54, Adriano dos Santos Fernandes wrote:

On 26/02/2022 22:05, Adriano dos Santos Fernandes wrote:

I will report back some numbers (memory, prepare times).


Here is a performance test I did: https://pastebin.com/3UnB5BNU

It's relative simple (not much indices) and common metadata.

It's tested as whole (create database, create metadata, populate, run
queries and get results, drop database).

The last select has a statement size of 21.5KB.

For reference, "select 1 from rdb$database" has size 6KB.

Test timings:
- Without statement cache: 19800ms
- With statement cache: 16700ms


More than 10% is great!
I suppose it's with mentoned 2Mb cache.

One more question. Suppose some statement remains in a cache for very 
long time cause it's reused again and again. That's fine - but with DB 
grow optimal plan can change. Is it solved somehow? Suppose in first 
implementation not, but are there plans to solve it?





Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] isc_dpb_lc_ctype and isc_dpb_set_db_charset and isc_dpb_utf8_filename

2022-02-28 Thread Alex Peshkoff via Firebird-devel

On 2/28/22 13:38, Jiří Činčura wrote:

Does the isc_dpb_utf8_filename imply also UTF8 strings in TPB (i.e. for table 
names used with isc_tpb_lock_write, etc.)?



They are expected in attachment charset.




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Compiled statement cache

2022-02-28 Thread Adriano dos Santos Fernandes
On 26/02/2022 22:05, Adriano dos Santos Fernandes wrote:
> 
> I will report back some numbers (memory, prepare times).
> 

Here is a performance test I did: https://pastebin.com/3UnB5BNU

It's relative simple (not much indices) and common metadata.

It's tested as whole (create database, create metadata, populate, run
queries and get results, drop database).

The last select has a statement size of 21.5KB.

For reference, "select 1 from rdb$database" has size 6KB.

Test timings:
- Without statement cache: 19800ms
- With statement cache: 16700ms


Adriano


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] isc_dpb_lc_ctype and isc_dpb_set_db_charset and isc_dpb_utf8_filename

2022-02-28 Thread Alex Peshkoff via Firebird-devel

On 2/28/22 13:40, Jiří Činčura wrote:

Also, does the isc_dpb_utf8_filename imply UTF8 for database name in i.e. 
op_attach (not DPB, the name that's before DPB)?



Yes.




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] isc_dpb_lc_ctype and isc_dpb_set_db_charset and isc_dpb_utf8_filename

2022-02-28 Thread Jiří Činčura
> Also, does the isc_dpb_utf8_filename imply UTF8 for database name in 
> i.e. op_attach (not DPB, the name that's before DPB)?

Obviously it has to. I somewhat thought the DPB contains database name as well. 
Silly me.

-- 
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/



Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] isc_dpb_lc_ctype and isc_dpb_set_db_charset and isc_dpb_utf8_filename

2022-02-28 Thread Jiří Činčura
Also, does the isc_dpb_utf8_filename imply UTF8 for database name in i.e. 
op_attach (not DPB, the name that's before DPB)?

-- 
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/



Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] isc_dpb_lc_ctype and isc_dpb_set_db_charset and isc_dpb_utf8_filename

2022-02-28 Thread Jiří Činčura
Does the isc_dpb_utf8_filename imply also UTF8 strings in TPB (i.e. for table 
names used with isc_tpb_lock_write, etc.)?

-- 
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/



Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] isc_arg_string in status vector

2022-02-28 Thread Adriano dos Santos Fernandes
On 28/02/2022 07:17, Alex Peshkoff via Firebird-devel wrote:
> On 2/28/22 13:10, Jiří Činčura wrote:
>> Hi *,
>>
>> If I get pointer to a string in isc_arg_string in status vector the
>> encoding is UTF8 if isc_dpb_utf8_filename was specified and
>> ANSI/system charset when isc_dpb_utf8_filename was not specified?
>>
> 
> Data in status vector should be according to attachment charset and not
> affected by isc_dpb_utf8_filename.
> If that's not so then it should be a bug.
> 
> ps.In some cases error may happen when trasliterating UTF8 line to
> attachment charset. In that case strig willl be returned is UTF.
> 

But before attachment is done that does not happen and strings are
returned as is (for example, error about non-existent file in Windows
ANSI encoding).

To convert charsets, database must be opened currently.


Adriano


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] isc_dpb_lc_ctype and isc_dpb_set_db_charset and isc_dpb_utf8_filename

2022-02-28 Thread Dimitry Sibiryakov

Jiří Činčura wrote 28.02.2022 11:16:

Can somebody explain me how isc_dpb_lc_ctype and isc_dpb_set_db_charset and 
isc_dpb_utf8_filename relate to each other.


  isc_dbp_lc_ctype establish charsert for all data returned from server (unless 
explicitly overridden in message metadata).
  isc_dpb_db_charset is default database charset and used only during 
createDatabase().
  isc_dpb_utf8_filename establish charset of DPB items themselves (and database 
filename obviously).


--
  WBR, SD.


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] isc_arg_string in status vector

2022-02-28 Thread Alex Peshkoff via Firebird-devel

On 2/28/22 13:10, Jiří Činčura wrote:

Hi *,

If I get pointer to a string in isc_arg_string in status vector the encoding is 
UTF8 if isc_dpb_utf8_filename was specified and ANSI/system charset when 
isc_dpb_utf8_filename was not specified?



Data in status vector should be according to attachment charset and not 
affected by isc_dpb_utf8_filename.

If that's not so then it should be a bug.

ps.In some cases error may happen when trasliterating UTF8 line to 
attachment charset. In that case strig willl be returned is UTF.






Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] isc_dpb_lc_ctype and isc_dpb_set_db_charset and isc_dpb_utf8_filename

2022-02-28 Thread Jiří Činčura
Hi *,

Can somebody explain me how isc_dpb_lc_ctype and isc_dpb_set_db_charset and 
isc_dpb_utf8_filename relate to each other. In .NET provider these are used 
somewhat chaotically and I'd like to fix that.

-- 
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] isc_arg_string in status vector

2022-02-28 Thread Dimitry Sibiryakov

Jiří Činčura wrote 28.02.2022 11:10:

If I get pointer to a string in isc_arg_string in status vector the encoding is 
UTF8 if isc_dpb_utf8_filename was specified and ANSI/system charset when 
isc_dpb_utf8_filename was not specified?


  It's encoding should match dpb_lc_ctype setting. isc_dpb_utf8_filename 
doesn't imply utf8 lc_ctype.


--
  WBR, SD.


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] isc_arg_string in status vector

2022-02-28 Thread Jiří Činčura
Hi *,

If I get pointer to a string in isc_arg_string in status vector the encoding is 
UTF8 if isc_dpb_utf8_filename was specified and ANSI/system charset when 
isc_dpb_utf8_filename was not specified?

-- 
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel