txo (claim_id) column index

This commit is contained in:
Lex Berezhny 2018-10-09 23:40:02 -04:00
parent 73519f8c6a
commit ad13282494
2 changed files with 6 additions and 2 deletions

View file

@ -92,7 +92,7 @@ def maybe_paginate(get_records: Callable, get_record_count: Callable,
})
return {
"items": (yield get_records(**constraints)),
"total_pages": ((yield get_record_count(**constraints)) + (page_size-1)) / page_size,
"total_pages": int(((yield get_record_count(**constraints)) + (page_size-1)) / page_size),
"page": page, "page_size": page_size
}
return (yield get_records(**constraints))

View file

@ -22,13 +22,17 @@ class WalletDatabase(BaseDatabase):
is_buy boolean not null default 0,
is_sell boolean not null default 0
);
create index txo_claim_id_idx on txo (claim_id);
"""
CREATE_TABLES_QUERY = (
BaseDatabase.CREATE_TX_TABLE +
BaseDatabase.CREATE_PUBKEY_ADDRESS_TABLE +
BaseDatabase.CREATE_PUBKEY_ADDRESS_INDEX +
CREATE_TXO_TABLE +
BaseDatabase.CREATE_TXI_TABLE
BaseDatabase.CREATE_TXO_INDEX +
BaseDatabase.CREATE_TXI_TABLE +
BaseDatabase.CREATE_TXI_INDEX
)
def txo_to_row(self, tx, address, txo):