mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 17:23:03 +01:00
Misc.
This commit is contained in:
parent
04defe2dee
commit
854da4e241
@ -25,7 +25,7 @@ B) Try to deliver conjuntions made on a UNION inside every single stream.
|
|||||||
C) Cardinality calculation has been improved for a better estimated value.
|
C) Cardinality calculation has been improved for a better estimated value.
|
||||||
|
|
||||||
D) MERGE/SORT operation may now be generated for inner joins using equality
|
D) MERGE/SORT operation may now be generated for inner joins using equality
|
||||||
comparsion on expressions.
|
comparison on expressions.
|
||||||
|
|
||||||
SELECT Count(*) FROM
|
SELECT Count(*) FROM
|
||||||
Relations r
|
Relations r
|
||||||
@ -33,7 +33,7 @@ D) MERGE/SORT operation may now be generated for inner joins using equality
|
|||||||
WHERE
|
WHERE
|
||||||
rc.CategoryID = 3
|
rc.CategoryID = 3
|
||||||
|
|
||||||
E) When a UNIQUE index can be fully matched (equality) used on a relation, use this
|
E) When a UNIQUE index used on a relation can be fully matched (equality), use this
|
||||||
index and forget any possible indexes.
|
index and forget any possible indexes.
|
||||||
|
|
||||||
F) Indexed order read with an OUTER JOIN.
|
F) Indexed order read with an OUTER JOIN.
|
||||||
@ -56,7 +56,7 @@ G) Ignore NULL values in index scan for operators other than IS NULL and Equival
|
|||||||
Note: This works currently only at single segment indexes.
|
Note: This works currently only at single segment indexes.
|
||||||
|
|
||||||
|
|
||||||
H) Calculate with more accurate selectivity for compound indexes which are partially
|
H) Calculate with more accuracy selectivity for compound indexes which are partially
|
||||||
matched with conjunctions. Due this we can now use cost-based approach also for
|
matched with conjunctions. Due this we can now use cost-based approach also for
|
||||||
partially matched indexes.
|
partially matched indexes.
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ J) STARTING WITH can be used inside compound indexes on every segment, but only
|
|||||||
SELECT * FROM Relations WHERE FirstName = 'Joe' and LastName STARTING WITH 'D'
|
SELECT * FROM Relations WHERE FirstName = 'Joe' and LastName STARTING WITH 'D'
|
||||||
|
|
||||||
K) Use AND conjunctions also inside OR conjunctions to help with matching on a
|
K) Use AND conjunctions also inside OR conjunctions to help with matching on a
|
||||||
compound index. The same calculation for every left and right node of a OR
|
compound index. The same calculation for every left and right node of an OR
|
||||||
conjunction is used as for the AND conjunctions.
|
conjunction is used as for the AND conjunctions.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
@ -1227,10 +1227,10 @@ InversionCandidate* OptimizerRetrieval::generateInversion(RecordSource** rsb)
|
|||||||
// very safe at the moment, but in our case Array holds a sorted list.
|
// very safe at the moment, but in our case Array holds a sorted list.
|
||||||
// However SortedArray class should be updated to handle join right!
|
// However SortedArray class should be updated to handle join right!
|
||||||
matches.join(invCandidate->matches);
|
matches.join(invCandidate->matches);
|
||||||
size_t pos;
|
|
||||||
tail = optimizer->opt_conjuncts.begin();
|
tail = optimizer->opt_conjuncts.begin();
|
||||||
for (; tail < opt_end; tail++) {
|
for (; tail < opt_end; tail++) {
|
||||||
if (!(tail->opt_conjunct_flags & opt_conjunct_used)) {
|
if (!(tail->opt_conjunct_flags & opt_conjunct_used)) {
|
||||||
|
size_t pos;
|
||||||
if (matches.find(tail->opt_conjunct_node, pos)) {
|
if (matches.find(tail->opt_conjunct_node, pos)) {
|
||||||
tail->opt_conjunct_flags |= opt_conjunct_matched;
|
tail->opt_conjunct_flags |= opt_conjunct_matched;
|
||||||
}
|
}
|
||||||
|
@ -1561,12 +1561,12 @@ bool Mnt::get()
|
|||||||
const char* start = device;
|
const char* start = device;
|
||||||
|
|
||||||
if (n<5)
|
if (n<5)
|
||||||
{ return false;}
|
return false;
|
||||||
|
|
||||||
const char* iflag = strchr(device, ':');
|
const char* iflag = strchr(device, ':');
|
||||||
if (iflag)
|
if (iflag)
|
||||||
{
|
{
|
||||||
node = tstring( start , size_t(iflag-start) );
|
node = tstring( start , size_t(iflag - start) );
|
||||||
path = tstring( ++iflag );
|
path = tstring( ++iflag );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -4716,10 +4716,9 @@ static RecordSource* gen_retrieval(thread_db* tdbb,
|
|||||||
const bool ods11orHigher = (dbb->dbb_ods_version >= ODS_VERSION11);
|
const bool ods11orHigher = (dbb->dbb_ods_version >= ODS_VERSION11);
|
||||||
if (ods11orHigher && !relation->rel_file) {
|
if (ods11orHigher && !relation->rel_file) {
|
||||||
// For ODS11 and higher databases we can use new calculations
|
// For ODS11 and higher databases we can use new calculations
|
||||||
InversionCandidate* candidate = NULL;
|
|
||||||
OptimizerRetrieval* optimizerRetrieval = FB_NEW(*tdbb->getDefaultPool())
|
OptimizerRetrieval* optimizerRetrieval = FB_NEW(*tdbb->getDefaultPool())
|
||||||
OptimizerRetrieval(*tdbb->getDefaultPool(), opt, stream, outer_flag, inner_flag, sort_ptr);
|
OptimizerRetrieval(*tdbb->getDefaultPool(), opt, stream, outer_flag, inner_flag, sort_ptr);
|
||||||
candidate = optimizerRetrieval->getInversion(&rsb);
|
InversionCandidate* candidate = optimizerRetrieval->getInversion(&rsb);
|
||||||
if (candidate && candidate->inversion) {
|
if (candidate && candidate->inversion) {
|
||||||
inversion = candidate->inversion;
|
inversion = candidate->inversion;
|
||||||
}
|
}
|
||||||
@ -5735,11 +5734,11 @@ static jrd_nod* get_unmapped_node(thread_db* tdbb, jrd_nod* node,
|
|||||||
SET_TDBB(tdbb);
|
SET_TDBB(tdbb);
|
||||||
|
|
||||||
// Check if node is a mapping and if so unmap it, but
|
// Check if node is a mapping and if so unmap it, but
|
||||||
// only for root nodes (not contained in an other node).
|
// only for root nodes (not contained in another node).
|
||||||
// This can be expanded by checking complete expression
|
// This can be expanded by checking complete expression
|
||||||
// (Then don't forget to leave aggregate-functions alone
|
// (Then don't forget to leave aggregate-functions alone
|
||||||
// in case of aggregate rse)
|
// in case of aggregate rse)
|
||||||
// Because this is only to help using a index we keep
|
// Because this is only to help using an index we keep
|
||||||
// it simple.
|
// it simple.
|
||||||
if ((node->nod_type == nod_field) &&
|
if ((node->nod_type == nod_field) &&
|
||||||
((USHORT)(IPTR) node->nod_arg[e_fld_stream] == shellStream))
|
((USHORT)(IPTR) node->nod_arg[e_fld_stream] == shellStream))
|
||||||
|
Loading…
Reference in New Issue
Block a user