Skip to content

Commit f9a5058

Browse files
committed
del create timestamp index
1 parent 35b822b commit f9a5058

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/main/java/org/tron/core/db/api/StoreAPI.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public List<Transaction> getTransactionsFromThis(String address, long offset, lo
100100
index.retrieve(
101101
equal(TransactionIndex.OWNERS, address),
102102
queryOptions(
103-
orderBy(ascending(TransactionIndex.INDEX_CREATE_TIMESTAMP))))) {
103+
orderBy(ascending(TransactionIndex.TIMESTAMP))))) {
104104
if (limit > TRANSACTIONS_COUNT_LIMIT_MAX) {
105105
limit = TRANSACTIONS_COUNT_LIMIT_MAX;
106106
}
@@ -118,7 +118,7 @@ public List<Transaction> getTransactionsToThis(String address, long offset, long
118118
index.retrieve(
119119
equal(TransactionIndex.TOS, address),
120120
queryOptions(
121-
orderBy(ascending(TransactionIndex.INDEX_CREATE_TIMESTAMP))))) {
121+
orderBy(ascending(TransactionIndex.TIMESTAMP))))) {
122122
if (limit > TRANSACTIONS_COUNT_LIMIT_MAX) {
123123
limit = TRANSACTIONS_COUNT_LIMIT_MAX;
124124
}

src/main/java/org/tron/core/db/api/index/TransactionIndex.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public class TransactionIndex extends AbstractIndex<TransactionCapsule, Transact
2727
public static Attribute<WrappedByteArray, String> OWNERS;
2828
public static Attribute<WrappedByteArray, String> TOS;
2929
public static Attribute<WrappedByteArray, Long> TIMESTAMP;
30-
public static Attribute<WrappedByteArray, Long> INDEX_CREATE_TIMESTAMP;
3130

3231
@Autowired
3332
public TransactionIndex(
@@ -42,7 +41,6 @@ public void init() {
4241
index.addIndex(DiskIndex.onAttribute(OWNERS));
4342
index.addIndex(DiskIndex.onAttribute(TOS));
4443
index.addIndex(DiskIndex.onAttribute(TIMESTAMP));
45-
index.addIndex(DiskIndex.onAttribute(INDEX_CREATE_TIMESTAMP));
4644
}
4745

4846
@Override
@@ -66,8 +64,5 @@ protected void setAttribute() {
6664
.collect(Collectors.toList()));
6765
TIMESTAMP =
6866
attribute("timestamp", bytes -> getObject(bytes).getRawData().getTimestamp());
69-
INDEX_CREATE_TIMESTAMP =
70-
attribute("index create timestamp", bytes -> System.currentTimeMillis());
71-
7267
}
7368
}

0 commit comments

Comments
 (0)