[Firebird-devel] [FB-Tracker] Created: (CORE-5434) Read-only transactions in SuperServer could not write Header and TIP pages immediately after edit

2017-01-03 Thread Vlad Khorsun (JIRA)
Read-only transactions in SuperServer could not write Header and TIP pages 
immediately after edit
-

 Key: CORE-5434
 URL: http://tracker.firebirdsql.org/browse/CORE-5434
 Project: Firebird Core
  Issue Type: Improvement
  Components: Engine
Reporter: Vlad Khorsun


Currently engine writes contents of Header and TIP pages to disk immediately 
after any change (for ex. transaction start increments value of "Next 
transaction" counter, commit changes transaction state etc).
I.e. Header and TIP pages are written to disk not waiting for commit (flush).
This was done by at least two major reasons:
a) safety
b) in CS (and SC) page locks for Header and TIP pages is released immediately 
after use to avoid AST overhead

In the case of many light read-only transactions these writes makes almost 100% 
of whole transaction time.

Since read-only transactions does not change data it is safe to update on disk 
contents of Header and TIP pages 
somewhat later, for example when write transaction started (or committed) or 
when whole page cache is flushed
at database shutdown.

Note, reason (b) doesn't affect SuperServer.

So, improvement is that read-only transaction will not force write of 
Header\TIP page content to disk immediately after change 
(in SS mode, of course). In the case of many light read-only transactions it 
gives significant performance gain.

PS to address this issue in CS mode there is more complex solution, probably it 
will be implemented in v4 a bit later


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Firebird 4 features

2017-01-03 Thread Dimitry Sibiryakov
30.12.2016 17:06, Dmitry Yemanov wrote:
>> Do anybody object if I try to dig a little into CORE-5064?
> No, feel free.

   I've managed to make binary strings accessible at sql level, but found that 
whole 
engine, starting from dsc is not prepared to handle sql_sub_type and character 
set 
separately. Thus isql and API has no way to distinguish between "varchar(10) 
character set 
octets" and "varbinary(10)".
   Should I dig deeper and separate them everywhere through engine or to offer 
patch as is?


-- 
   WBR, SD.

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Binary text subtype

2017-01-03 Thread Mark Rotteveel
On 2-1-2017 15:51, Dimitry Sibiryakov wrote:
>Hello, All.
>
>What would be the right constant for binary field subtype: ttype_binary, 
> CS_BINARY or
> dsc_text_type_fixed? They all have value 1.
>

As far as I can tell, you should use isc_blob_untyped, see consts_pub.h:

/*/
/* Blob Subtypes */
/*/

/* types less than zero are reserved for customer use */

#define isc_blob_untyped  0

/* internal subtypes */

#define isc_blob_text 1
#define isc_blob_blr  2
#define isc_blob_acl  3
#define isc_blob_ranges   4
#define isc_blob_summary  5
#define isc_blob_format   6
#define isc_blob_tra  7
#define isc_blob_extfile  8
#define isc_blob_debug_info   9
#define isc_blob_max_predefined_subtype   10

CS_BINARY is the character set id of octets/binary, and ttype_binary as 
well, as it is defined as:

#define ttype_binaryCS_BINARY   // 1

Given the definition of dsc_text_type_fixed and his peers, I suspect 
this also applies to dsc_text_type_fixed.

Mark
-- 
Mark Rotteveel

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel