CREATE INDEX CONCURRENTLY transactions_sorting_idx ON transactions(block_timestamp, index_in_chunk);
(We never put CONCURRENTLY to migration files, I decided that I should be consistent here)
Applying it to 35.233.39.106 (it's copy of mainnet with data till 10th of May 2021) took 75 seconds.
Select from @frol works in a moment.
Important: columns block_timestamp, index_in_chunkshould always go in this order, and we should specify desc for both or for no columns. That anyway sounds logical.
Resolves #135
To apply it to mainnet, we should use
(We never put
CONCURRENTLY
to migration files, I decided that I should be consistent here)Applying it to
35.233.39.106
(it's copy of mainnet with data till 10th of May 2021) took 75 seconds. Select from @frol works in a moment. Important: columnsblock_timestamp, index_in_chunk
should always go in this order, and we should specifydesc
for both or for no columns. That anyway sounds logical.For 14M lines, it took 550 MB of storage. Mainnet has 17M lines, so hopefully it should not be so far from these numbers.
Can I apply it to mainnet?