Commit aed69e6
sql: only create sql indices after initial load of data.
This makes a big difference for large tables. Consider 1.6M channelmoves,
which took 82 seconds to populate, now takes 17 seconds:
Before:
plugin-sql: Time to call listchannelmoves: 10.380341485 seconds
plugin-sql: Time to refresh channelmoves: 82.311287310 seconds
After:
plugin-sql: Time to call listchannelmoves: 9.962815480 seconds
plugin-sql: Time to refresh channelmoves: 15.711549299 seconds
plugin-sql: Time to refresh + create indices for channelmoves: 17.100151235 seconds
tests/test_coinmoves.py::test_generate_coinmoves (50,000):
Time (from start to end of l2 node): 27 seconds
Worst latency: 16.0 seconds
Changelog-Changed: Plugins: `sql` initial load for tables is much faster (e.g 82 to 17 seconds for very large channelmoves table).
Signed-off-by: Rusty Russell <[email protected]>1 parent d996522 commit aed69e6
1 file changed
+30
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
| |||
490 | 492 | | |
491 | 493 | | |
492 | 494 | | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
493 | 517 | | |
494 | 518 | | |
495 | 519 | | |
| |||
505 | 529 | | |
506 | 530 | | |
507 | 531 | | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
508 | 537 | | |
509 | 538 | | |
510 | 539 | | |
| |||
1527 | 1556 | | |
1528 | 1557 | | |
1529 | 1558 | | |
| 1559 | + | |
1530 | 1560 | | |
1531 | 1561 | | |
1532 | 1562 | | |
| |||
1707 | 1737 | | |
1708 | 1738 | | |
1709 | 1739 | | |
1710 | | - | |
1711 | | - | |
1712 | | - | |
1713 | | - | |
1714 | | - | |
1715 | | - | |
1716 | | - | |
1717 | | - | |
1718 | | - | |
1719 | | - | |
1720 | | - | |
1721 | | - | |
1722 | | - | |
1723 | | - | |
1724 | | - | |
1725 | | - | |
1726 | | - | |
1727 | | - | |
1728 | | - | |
1729 | 1740 | | |
1730 | 1741 | | |
1731 | 1742 | | |
| |||
1738 | 1749 | | |
1739 | 1750 | | |
1740 | 1751 | | |
1741 | | - | |
1742 | 1752 | | |
1743 | 1753 | | |
1744 | 1754 | | |
| |||
0 commit comments