This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT id | |
| FROM trades | |
| WHERE portfolio_id = :portfolio_id | |
| AND type = 'fee' | |
| ORDER BY date DESC | |
| LIMIT 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE portfolio | |
| ( | |
| id BIGINT AUTO_INCREMENT PRIMARY KEY | |
| ); | |
| CREATE TABLE trades | |
| ( | |
| id BIGINT AUTO_INCREMENT PRIMARY KEY, | |
| portfolio_id BIGINT NOT NULL, | |
| type VARCHAR(255) NOT NULL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| portfolio.trades() | |
| .stream() | |
| .filter(trade -> trade instanceof Fee) | |
| .max(Comparators.comparing(Trade::date)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ qc biw CollectAndRenderProfileSvg QUERY RunAllCalculatePortfolioBalances > RunAllCalculatePortfolioBalances.svg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ qc biw Help CollectAndRenderProfileSvg | |
| CollectAndRenderProfileSvg( | |
| @Param(QUERY, BATCH_QUEUE, or POOL) Kind kind, | |
| @NoConcurrentExecution @Param(queue name, query name, session id, or thread pool prefix) String identifier, | |
| @Param(stop recording after this many seconds) int stopNumSeconds, | |
| @Optional(11) @Param(number of samples to record per second) double samplesPerSecond, | |
| @Optional(0) @Param(negative value to disable) int stopWhenAllWorkersIdleFor, | |
| @Optional(0.1) @Param(disable further analysis of traces with less than given % of parent traces) Scalar filterThreshold | |
| ): String |