SELECT *
FROM data t
LEFT JOIN data c ON KEYS t.conversion
WHERE t.type = "transaction"
AND c.type = "conversion"
AND t.transaction_creationDate >= 1454284800000
AND t.transaction_creationDate <= 1456704000000
LIMIT {{limit}}
OFFSET {{offset}};
We get about 20,000 results returned before the system returns the error. Our limit/offset is 1000.
A single result looks like:
[
{
“c”: {
“transaction”: "transaction:A1234567890”,
“createdAt”: 1467801689486,
“conversion_buyCurrency”: “USD”,
“conversion_client”: “client1”,
“conversion_clientBuyAmount”: 100,
“conversion_clientRate”: 1.4289,
“conversion_clientSellAmount”: 50,
“conversion_conversionDate”: 1454284800000,
“conversion_coreRate”: 1.4289,
“conversion_createdAt”: 1454317346000,
“conversion_currencyPair”: “GBPUSD”,
“conversion_depositAmount”: 0,
“conversion_depositRequired”: false,
“conversion_depositStatus”: “not_required”,
“conversion_fixedSide”: “buy”,
“conversion_midMarketRate”: 1.1234,
“conversion_partnerBuyAmount”: 0,
“conversion_partnerSellAmount”: 0,
“conversion_partnerStatus”: “funds_arrived”,
“conversion_sellCurrency”: “GBP”,
“conversion_settlementDate”: 1454344200000,
“conversion_shortReference”: "20160201-AAAAAA”,
“conversion_status”: “trade_settled”,
“conversion_updatedAt”: 1454348063000,
“Payments”: [
"Payment:1234”
],
“Settlement”: "Settlement:1234”,
“type”: “conversion”,
“updatedAt”: 1468092288198
},
“t”: {
“transaction_api”: “API”,
“transaction_deliveryMethod”: “PICKUP”,
“transaction_fixedFee”: 0.00,
“transaction_folioNumber”: “12345678”,
“transaction_fraudReported”: 0,
“transaction_id”: "B1234567890”,
“transaction_lastUpdateDate”: 1454385748000,
“transaction_originalId”: "20160201-AAAAAA”,
“transaction_originalSendingPrincipal”: 44.12,
“transaction_payer”: “PAYER”,
“transaction_payerCode”: “CL”,
“transaction_payerFolioNumber”: “1234567”,
“transaction_payerLocationCode”: “LOCATION”,
“transaction_paymentFolio”: "B1234567890”,
“transaction_paymentStatus”: “ACCEPTED”,
“transaction_paymentType”: “DEBITCARD”,
“transaction_payoutCountry”: “PHL”,
“transaction_payoutCurrency”: “PHP”,
“transaction_payoutPrincipal”: 2000.00,
“transaction_purpose”: “PURPOSE”,
“transaction_rate”: 12.3456,
“transaction_rateModifier”: 0.00,
“transaction_senderCity”: “City”,
“transaction_senderCountry”: “GBR”,
“transaction_senderId”: 711815,
“transaction_senderType”: “INDIVIDUAL”,
“transaction_sendingCountry”: “GBR”,
“transaction_sendingCurrency”: “GBP”,
“transaction_sendingPrincipal”: 50.00,
“transaction_sequentialNumber”: “8387”,
“transaction_settlementCreated”: 1454025600000,
“transaction_settlementCutOffTime”: “EVENING”,
“transaction_settlementId”: 56064,
“transaction_settlementPayer”: “Payer”,
“transaction_settlementShortReference”: "20160129-AAAAAA”,
“transaction_settlementStatus”: 2,
“transaction_settlementSubmitTime”: 1454340711000,
“transaction_status”: “CLOSED_PAID_OUT”,
“transaction_statusHistory”: [
{
“createdAt”: 1454285042000,
“status”: “PAYMENT_AWAITING_FUNDS”
},
{
“createdAt”: 1454319252000,
“status”: “PAID_AVAILABLE_FOR_PICK_UP”
},
{
“createdAt”: 1454385747000,
“status”: “CLOSED_PAID_OUT”
}
],
“transaction_totalSale”: 100,
“transaction_userId”: 1234,
“transaction_variableFee”: 0,
“createdAt”: 1467800625935,
“emisSettlement”: “emisSettlement:20160202GBP”,
“emistransaction”: “emistransaction:B1523072508”,
“payer”: “payer:BDO”,
“conversion”: "conversion:1234”,
“Payments”: [
"Payment:1234”
],
“Settlement”: "Settlement:1234”,
“type”: “transaction”,
“updatedAt”: 1468092288193
}
}
]
We are running Couchbase 4.5 and we have 24165MB of memory. Here is a breakdown:
Data RAM Quota: 8704
Index RAM Quota: 2048
Full Text RAM Quota: 512
Thank you very much for the help and sorry it took me so long to respond.
Cheers
Mike Maik