8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-30 20:03:03 +01:00
Commit Graph

238 Commits

Author SHA1 Message Date
asfernandes
c916c09e42 Refactored out OPT_expression_equal while fixing checking of sameAs involving CASTs. Problem saw by Dmitry. 2011-02-12 18:11:43 +00:00
asfernandes
c7f7a763d1 Avoid casts. 2011-02-12 17:41:49 +00:00
dimitr
4d2f09c8f0 Cleaned up the unused (since FB2) parameter. 2011-02-12 14:13:40 +00:00
dimitr
9bd051b3e7 Refactored expression equality to make it independent from the stream being optimized. 2011-02-12 14:01:36 +00:00
dimitr
bb1f7ad9a6 Implement CORE-3076: Better performance for (table.field = :param or :param = -1) in where clause. 2011-02-07 17:54:24 +00:00
dimitr
6e6d341d4f Front ported CORE-3312: Sub-optimal join plan when the slave table depends on the master one via the OR predicate. 2011-01-29 11:34:25 +00:00
dimitr
46ef6561a4 Misc. 2011-01-16 08:42:42 +00:00
asfernandes
c9ec26c0c3 Feature CORE-726 - Boolean data type 2010-12-18 02:17:06 +00:00
asfernandes
a3064848d6 Make ExprNodes and RecordSourceNodes reference others directly instead of via jrd_nod.
Store ValueExprNodes instead of jrd_nod in the metadata cache.
Make RecordSourceNode child of ExprNode as they share most operations.
Get rid of the JRD visitors in favor of direct calls.
Convert assignments statement lists created inside expressions to separate source and targets ValuesExprNodes.
2010-11-21 03:47:29 +00:00
asfernandes
4dea3a42a1 Remove dependency of jrd_nod in ExprNode 2010-11-14 22:31:42 +00:00
asfernandes
3eb252ec5f Refactored DSQL nodes: nod_derived_field, nod_map, nod_dbkey and nod_rec_version.
Refactored JRD nodes: blr_field (JRD side only), blr_dbkey, blr_record_version and blr_stmt_expr.
2010-11-14 17:25:48 +00:00
asfernandes
5ee982afb9 Refactor blr_derived_expr 2010-11-07 22:12:14 +00:00
asfernandes
1d702dae81 Refactor blr_via, blr_from, blr_maximum, blr_minimum, blr_count, blr_average and blr_total 2010-11-07 02:18:58 +00:00
asfernandes
e65fd8fea8 1) Refactor CAST.
2) Fixed CORE-3204 - Constraint violation error of CAST is not raised inside views
2010-11-01 23:57:31 +00:00
asfernandes
3317eeeebc Refactor literal values. 2010-10-24 00:26:00 +00:00
asfernandes
16ff0c51ce Refactor NULL expression 2010-10-22 15:00:22 +00:00
asfernandes
2e0da292df Refactor EXTRACT 2010-10-16 18:53:25 +00:00
asfernandes
2dcef5c7ce Refactor *_LENGTH functions 2010-10-16 18:17:00 +00:00
asfernandes
aa78df6f91 Refactor SUBSTRING 2010-10-16 17:42:04 +00:00
alexpeshkoff
e05c1a825f Moved some more .h-files to common from jrd as Vlad suggested 2010-10-13 10:39:52 +00:00
alexpeshkoff
83d6a2f88c Restored a lot of changes, rolled back by me unintentionally 2010-10-12 11:36:51 +00:00
alexpeshkoff
2dc25a44bb OSRI and new posix build 2010-10-12 08:02:57 +00:00
asfernandes
ac3c00d503 1) Refactored LOWER, UPPER and TRIM.
2) Fixed CORE-3174 - Expression index with TRIM may lead to incorrect indexed lookup
2010-10-09 18:39:45 +00:00
asfernandes
4d00fec2d6 Refactor parameters and GEN_ID. 2010-10-09 01:57:37 +00:00
asfernandes
b49391c8d0 Misc 2010-09-25 23:08:18 +00:00
robocop
c7abd52cea Misc. 2010-09-24 09:23:12 +00:00
asfernandes
9b8171d5c1 1) Refactor nod_value_if.
2) Created ExprNode::expressionEqual method to replace a new big and ugly switch.
3) Make boolean referencers use BoolExprNode instead of jrd_nod, except nod_validate for now. This includes BinaryBoolNode and NotBoolNode working without jrd_nod references.
4) Rework in the impure allocation code (replace "csb_impure += ..." by CMP_impure calls).
2010-09-20 16:07:50 +00:00
asfernandes
c1b5abfdf2 1) Refactor all types of boolean nodes.
2) Remove the scratch from the nodes.
2010-09-17 03:15:32 +00:00
asfernandes
b7b63becf3 Refactor a number of expression nodes: nod_add, nod_divide, nod_multiply, nod_negate, nod_user_name, nod_subtract, nod_current_date, nod_current_time, nod_current_timestamp, nod_add2, nod_subtract2, nod_multiply2, nod_divide2, nod_current_role, nod_internal_info 2010-09-04 21:36:41 +00:00
asfernandes
ada671c034 Refactor nod_index and nod_bit_* to InversionNode 2010-08-31 00:20:33 +00:00
asfernandes
8f857a6deb Refactor plan nodes to PlanNode 2010-08-29 20:20:19 +00:00
asfernandes
96f2829728 Refactor nod_map and nod_sort to type-safe MapNode and SortNode 2010-08-29 18:20:44 +00:00
asfernandes
48d83b8fef Refactor nod_rse, nod_relation, nod_procedure, nod_union, nod_aggregate and nod_window. 2010-08-24 03:25:01 +00:00
asfernandes
4c9eb2c3ce Correct double indirection (jrd_nod**) so const cascades to every dereference 2010-08-09 16:06:23 +00:00
asfernandes
dadc0f560c Const correction for EVL, EXE and they subsystems. Adjustments to CMP and OPT. 2010-08-09 15:48:51 +00:00
asfernandes
7f3dc62888 Frontport fix for CORE-3090 - Incorrect LEFT JOIN result using table and derived constant subquery 2010-08-07 02:10:08 +00:00
asfernandes
e37d097240 Misc 2010-05-22 02:00:45 +00:00
dimitr
d3f7b43c7e Let's calculate the exact cardinality for external tables. 2010-05-21 06:14:25 +00:00
dimitr
c6b776cdc8 Fixed the first part of the problem described in CORE-2933: Very slow execution of a script that creates a lot of metadata. 2010-05-17 09:47:08 +00:00
asfernandes
4763533669 Refactor jrd_req into JrdStatement (shared part) and jrd_req (execution of a statement).
Fixed some bugs found in the way.
2010-04-18 22:19:11 +00:00
asfernandes
fe9bf02848 Refactor user and system functions nodes 2010-04-05 18:43:11 +00:00
asfernandes
4b322bf94a Fix problem with ExprNodes in joins causing "no current record" error 2010-04-05 03:27:11 +00:00
dimitr
fe6d0c93b3 Correction for one of my prior optimizer commits. 2010-03-16 05:01:57 +00:00
asfernandes
d3ad05b7eb Misc 2010-03-14 15:33:06 +00:00
dimitr
c65e55c9e6 Fixed CORE-1550: Unnecessary index scan happens when the same index is mapped to both WHERE and ORDER BY clauses. 2010-03-11 10:03:32 +00:00
dimitr
76a9a59469 Reduced number of local variables. Thanks to Claudio. 2010-03-09 16:55:05 +00:00
robocop
be3660d221 Misc. 2010-03-07 04:30:35 +00:00
dimitr
413f771766 Actually, the optimizer doesn't need an expression index request to operate.
Moreover, I have a feeling that calling EVL from OPT is a bad design.
2010-02-26 09:51:48 +00:00
dimitr
42fbd2615b Front ported CORE-2833: Changing data that affects an expression index that contains references to null date fields fails.
Also, removed the duplicated (and, at the first glance, unnecessary) code that forced us to deal with the already_attached flag. To be tested in the field.
2010-02-26 09:02:22 +00:00
asfernandes
4f9b9161b4 Feature CORE-2006 - SUBSTRING with regular expression (SIMILAR TO) capability 2010-02-21 01:47:54 +00:00
dimitr
9b7f40c1f0 Minor code unification. 2010-02-20 06:39:35 +00:00
dimitr
c7853fa9e1 Fixed CORE-1295: Bad optimization of queries with DB_KEY. 2010-02-19 20:25:56 +00:00
dimitr
faae1821f5 More optimizations for window expressions. 2010-02-16 08:57:35 +00:00
robocop
835750a54c Misc. 2010-02-16 08:53:31 +00:00
asfernandes
c737d6a807 Create ExprNode class hierarchy.
Convert CONCATENATE and aggregate functions to it.

Fix some bugs:
- select sum(n) over (order by n2), sum(n) over (), n, n2 from x1;
- select (select 1 from x1 b where list(1, a.n) = 1) from x1 a;
2010-02-13 20:29:29 +00:00
dimitr
ccac0eac72 Fixed CORE-2822: Error "no current row for fetch operation" when subquery includes a non-trivial derived table. 2010-01-22 14:05:46 +00:00
dimitr
e2aab75891 Fixed the optimizer in regard to the partitioned window functions. 2010-01-19 07:52:38 +00:00
dimitr
df53be29bf Misc. 2010-01-18 11:39:34 +00:00
dimitr
5186898135 Misc. 2010-01-15 11:40:08 +00:00
dimitr
b795f91267 Misc. 2010-01-14 08:42:33 +00:00
asfernandes
d8c99a9be2 1) Make procedures and functions member of the same hierarchy (Routine class)
2) Some completion for external functions
2009-12-27 22:05:22 +00:00
dimitr
37b3b13956 Misc. 2009-12-14 16:43:47 +00:00
robocop
dae574f7f1 Misc, style and unused vars. 2009-12-13 10:41:53 +00:00
dimitr
753f4d62d5 Fixed the plan output (reversed order of view sub-elements) in HEAD (also broken by my yesterday's commit). 2009-12-10 15:03:56 +00:00
dimitr
916d9fab98 Fixed the plan output (table names) in HEAD (broken by my yesterday's commit). 2009-12-10 14:48:42 +00:00
dimitr
11495a55fb Refactored the whole RSB stuff into classes. They're inside the /recsrc sub-directory now.
Fixed the layering for WITH LOCK and (partially) ANY/ALL predicates.
Cleaned up the outdated code that never worked (mapping DISTINCT to an index, some VMS remainings).
Wiped out a lot of the pre-ODS11 optimizer logic. Some minor adjustments there.
Re-implemented the full outer join from scratch. This resolves CORE-2678 (full outer join cannot use available indices).
Resolved CORE-2796: DB_KEY is always zero for external tables.
Implemented the core part of the scrollable PSQL cursors. Implementation is still incomplete, but ready for testing.
Some other changes I don't recall at the moment ;-)

WARNING! The engine may be unstable. Please email me about any issues found.
2009-12-09 18:45:44 +00:00
asfernandes
a3dd1d0482 Misc 2009-11-26 00:20:59 +00:00
robocop
804ad6048a Restrict us to ODS11 and ODS12 until the dust settles down. 2009-11-24 11:42:56 +00:00
dimitr
e6909de7f7 Wipe out the SCROLLABLE_CURSORS code + minor cleanup.
Also, surfaced scrollability for PSQL cursors (without internal support yet).
2009-10-31 06:25:01 +00:00
dimitr
3a3512da8e Fixed CORE-2659: Sub-optimal (not indexed) query plan for outer joins involving complex views.
We don't need to validate all the view streams inside the optimizer, just those inside the e_derived_expr_expr argument.
2009-10-03 11:37:46 +00:00
robocop
3e66cd45f5 Comments. 2009-08-20 11:18:57 +00:00
dimitr
17b630c1fe More optimizer adjustments + named constants instead of hardcoded numbers.
In particular, this commit should resolve the degraded restore performance.
2009-08-19 09:18:30 +00:00
dimitr
ee941f9a3d Misc. 2009-07-08 15:09:47 +00:00
robocop
f7bf07d9be Style. 2009-07-03 11:02:17 +00:00
uid32383
e704280a59 Style. 2009-06-28 10:29:36 +00:00
dimitr
77dce5ac12 Fixed some issues with the optimizer, namely: (1) incorrect cost calculation for indexed retrievals in joins and (2) too pessimistic heuristics for indices with zero selectivity.
Also, I removed the restricition I put recently to address some issues reported in the tracker (it's no longer necessary).
2009-06-19 11:33:12 +00:00
dimitr
a082a6fba6 Slightly changed a bugfix for CORE-2078 to avoid affecting indexed retrievals.
It's a compromise targeted to resolve any regressions in v2.1.2 (like CORE-2411).
2009-05-14 15:41:48 +00:00
robocop
66b1227b22 Unused params, some formatting, cleanup. 2009-05-01 17:21:36 +00:00
robocop
888000e21e Unused function params. 2009-04-26 10:24:44 +00:00
robocop
a730fbf074 Get rid of more typedefs. 2009-04-03 10:07:55 +00:00
robocop
3689f15321 Style. 2009-01-20 08:33:59 +00:00
robocop
582cdf185b Style. 2009-01-14 09:19:00 +00:00
robocop
6406e45337 Shut up compiler warnings (unreferenced vars, uninitialized vars, compile-time conditional code, etc.) 2009-01-02 06:36:12 +00:00
asfernandes
5c97a235e3 Misc 2008-12-24 00:32:49 +00:00
robocop
2fadc0e456 Style. 2008-12-22 09:00:05 +00:00
asfernandes
5311dd5a5e Misc 2008-12-20 19:57:43 +00:00
robocop
9161be9116 Style. 2008-12-18 11:29:10 +00:00
dimitr
4fabeb3c6a Misc. 2008-11-23 12:53:29 +00:00
dimitr
6e4c0cd099 A better solution for CORE-2200 (Extremely slow executing a cross join of 3 tables in Firebird 2.X).
This time an optimizer level one.
2008-11-23 12:49:33 +00:00
alexpeshkoff
d8ea120ded AIX port - use FB_ prefix for alignment constants 2008-11-05 11:26:23 +00:00
robocop
43ee87b07d Misc. 2008-10-21 04:25:49 +00:00
asfernandes
ad716e38d9 Misc 2008-10-20 23:46:46 +00:00
dimitr
a58aaafdf2 Fixed CORE-2132: Indexed retrieval cannot be chosen if a stored procedure is used inside the comparison predicate. 2008-10-19 12:05:36 +00:00
asfernandes
7a5b0121d8 Misc 2008-09-14 23:17:58 +00:00
asfernandes
25d751ea32 New methods for array classes 2008-09-14 22:45:00 +00:00
dimitr
ddb3e8f07c An attempt to fix CORE-2078. This approach is hopefully a bit more clever than the pre-ODS11 one.
I'll be waiting for the customer's report before backporting into v2.0/v2.1.
2008-09-12 14:36:14 +00:00
dimitr
407a4741f8 Cleanup. 2008-09-12 09:19:32 +00:00
dimitr
aad133369c Cleanup. 2008-09-12 08:48:47 +00:00
asfernandes
22c65f0153 Misc 2008-09-10 02:21:13 +00:00
robocop
26727ea6c8 Misc. 2008-09-09 09:05:49 +00:00