[#2178] Improve FieldList. Avoid creating excessive array lists, where
simple (immutable) Field<?>[] are sufficient - Removed dependency between SelectFieldList and FieldList
This commit is contained in:
parent
7ce2b9d8c5
commit
058151a756
@ -79,7 +79,7 @@ public class BenchmarkTests<
|
||||
T785 extends TableRecord<T785>>
|
||||
extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T725, T639, T785> {
|
||||
|
||||
private static final int REPETITIONS_NEW_RECORD = 1000000;
|
||||
private static final int REPETITIONS_NEW_RECORD = 100000000;
|
||||
private static final int REPETITIONS_RECORD_INTO = 2000;
|
||||
private static final int REPETITIONS_FIELD_ACCESS = 1000000;
|
||||
private static final int REPETITIONS_SELECT = 100;
|
||||
|
||||
@ -209,7 +209,7 @@ abstract class AbstractResultQuery<R extends Record> extends AbstractQuery imple
|
||||
}
|
||||
}
|
||||
else {
|
||||
result = new ResultImpl<R>(ctx, new FieldList());
|
||||
result = new ResultImpl<R>(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -121,7 +121,7 @@ class Alias<Q extends QueryPart> extends AbstractQueryPart {
|
||||
else if (fieldAliases != null && asList(H2, MYSQL, ORACLE, SQLITE).contains(dialect)) {
|
||||
simulateDerivedColumnList = true;
|
||||
|
||||
FieldList fields = new SelectFieldList();
|
||||
SelectFieldList fields = new SelectFieldList();
|
||||
for (String fieldAlias : fieldAliases) {
|
||||
fields.add(field("null").as(fieldAlias));
|
||||
}
|
||||
|
||||
@ -72,12 +72,12 @@ implements
|
||||
/**
|
||||
* Generated UID
|
||||
*/
|
||||
private static final long serialVersionUID = -7918219502110473521L;
|
||||
private static final long serialVersionUID = -7918219502110473521L;
|
||||
|
||||
private final Table<?> table;
|
||||
private final FieldList aggregateFunctions;
|
||||
private Field<T> on;
|
||||
private FieldList in;
|
||||
private final Table<?> table;
|
||||
private final SelectFieldList aggregateFunctions;
|
||||
private Field<T> on;
|
||||
private SelectFieldList in;
|
||||
|
||||
Pivot(Table<?> table, Field<?>... aggregateFunctions) {
|
||||
super("pivot");
|
||||
|
||||
@ -44,7 +44,7 @@ import org.jooq.RenderContext;
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
class SelectFieldList extends FieldList {
|
||||
class SelectFieldList extends QueryPartList<Field<?>> {
|
||||
|
||||
private static final long serialVersionUID = 8850104968428500798L;
|
||||
|
||||
|
||||
@ -92,7 +92,7 @@ class SelectQueryImpl<R extends Record> extends AbstractSelect<R> implements Sel
|
||||
*/
|
||||
private static final long serialVersionUID = 1646393178384872967L;
|
||||
|
||||
private final FieldList select;
|
||||
private final SelectFieldList select;
|
||||
private String hint;
|
||||
private boolean distinct;
|
||||
private boolean forUpdate;
|
||||
@ -716,13 +716,13 @@ class SelectQueryImpl<R extends Record> extends AbstractSelect<R> implements Sel
|
||||
return getSelect1();
|
||||
}
|
||||
|
||||
final FieldList getSelect0() {
|
||||
final SelectFieldList getSelect0() {
|
||||
return select;
|
||||
}
|
||||
|
||||
final FieldList getSelect1() {
|
||||
final SelectFieldList getSelect1() {
|
||||
if (getSelect0().isEmpty()) {
|
||||
FieldList result = new SelectFieldList();
|
||||
SelectFieldList result = new SelectFieldList();
|
||||
|
||||
// [#109] [#489]: SELECT * is only applied when at least one table
|
||||
// from the table source is "unknown", i.e. not generated from a
|
||||
|
||||
Loading…
Reference in New Issue
Block a user