Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "plan": {
- "#operator": "Sequence",
- "~children": [
- {
- "#operator": "IndexScan3",
- "as": "D1",
- "covers": [
- "cover ((`D1`.`type`))",
- "cover ((`D1`.`specialCircumstanceName`))",
- "cover ((`D1`.`projectID`))",
- "cover ((`D1`.`inspectionObjectID`))",
- "cover ((`D1`.`spaceName`))",
- "cover ((((`D1`.`responsibleParties`)[0]).`documentID`))",
- "cover ((`D1`.`errorCodeName`))",
- "cover (substr0((meta((`D1`.`self`)).`id`), 0, 5))",
- "cover ((`D1`.`responsibleParties`))",
- "cover ((`D1`.`isDeleted`))",
- "cover ((`D1`.`spaceNrList`))",
- "cover ((`D1`.`proximusUnitName`))",
- "cover ((`D1`.`proximusObjectNrList`))",
- "cover ((`D1`.`inspectionObjectNumber`))",
- "cover ((`D1`.`selfRegulationTypeName`))",
- "cover ((`D1`.`detailName`))",
- "cover ((`D1`.`unitNrList`))",
- "cover ((`D1`.`detailNrList`))",
- "cover ((`D1`.`selfRegulationID`))",
- "cover ((`D1`.`proximusUnitNrList`))",
- "cover ((`D1`.`inspectionObjectTypeName`))",
- "cover ((`D1`.`unitName`))",
- "cover ((`D1`.`updatedAt`))",
- "cover ((`D1`.`sinceEpoch`))",
- "cover ((`D1`.`objectName`))",
- "cover ((`D1`.`objectNrList`))",
- "cover ((`D1`.`proximusObjectName`))",
- "cover ((`D1`.`photoIDs`))",
- "cover ((`D1`.`remedyStates`))",
- "cover ((`D1`.`spaceCategoryName`))",
- "cover ((`D1`.`specialCircumstanceAcronym`))",
- "cover ((meta(`D1`).`id`))"
- ],
- "index": "issue_filter_index",
- "index_id": "cd5e350fbac9fb06",
- "index_projection": {
- "entry_keys": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 6,
- 8,
- 9,
- 10,
- 11,
- 12,
- 13,
- 14,
- 15,
- 16,
- 17,
- 18,
- 19,
- 20,
- 21,
- 22,
- 23,
- 24,
- 25,
- 26,
- 27,
- 28,
- 29,
- 30
- ],
- "primary_key": true
- },
- "keyspace": "ispect",
- "namespace": "default",
- "spans": [
- {
- "exact": true,
- "range": [
- {
- "high": "\"defect\"",
- "inclusion": 3,
- "low": "\"defect\""
- }
- ]
- }
- ],
- "using": "gsi"
- },
- {
- "#operator": "Parallel",
- "~child": {
- "#operator": "Sequence",
- "~children": [
- {
- "#operator": "Let",
- "bindings": [
- {
- "expr": "(correlated (select raw (max([(`S1`.`inspectionNumber`), `S1`])[1]) from cover ((`D1`.`remedyStates`)) as `S1`)[0])",
- "var": "state"
- },
- {
- "expr": "substr0(cover ((meta(`D1`).`id`)), 0, 5)",
- "var": "docId"
- }
- ]
- },
- {
- "#operator": "Filter",
- "condition": "((((((cover ((`D1`.`type`)) = \"defect\") and (cover ((`D1`.`projectID`)) = \"project_1503412693_b208a02b-ce84-438a-bdf9-3e3ab28edd08\")) and (not (`docId` = \"_sync\"))) and ((cover ((`D1`.`isDeleted`)) is not valued) or (cover ((`D1`.`isDeleted`)) = false))) and ((`state`.`isRemedied`) = false)) and (((`state`.`remedyStatus`) is not valued) or ((((`state`.`remedyStatus`)[0]).`taggedAsRemediedBySubcontractor`) = false)))"
- },
- {
- "#operator": "InitialProject",
- "result_terms": [
- {
- "expr": "cover ((meta(`D1`).`id`))"
- },
- {
- "expr": "cover ((`D1`.`type`))"
- },
- {
- "expr": "cover ((`D1`.`projectID`))"
- },
- {
- "expr": "cover ((`D1`.`sinceEpoch`))"
- },
- {
- "expr": "cover ((`D1`.`updatedAt`))"
- },
- {
- "expr": "cover ((`D1`.`spaceCategoryName`))"
- },
- {
- "expr": "cover ((`D1`.`spaceName`))"
- },
- {
- "expr": "cover ((`D1`.`spaceNrList`))"
- },
- {
- "expr": "cover ((`D1`.`unitName`))"
- },
- {
- "expr": "cover ((`D1`.`unitNrList`))"
- },
- {
- "expr": "cover ((`D1`.`objectName`))"
- },
- {
- "expr": "cover ((`D1`.`objectNrList`))"
- },
- {
- "expr": "cover ((`D1`.`detailName`))"
- },
- {
- "expr": "cover ((`D1`.`detailNrList`))"
- },
- {
- "expr": "cover ((`D1`.`proximusUnitName`))"
- },
- {
- "expr": "cover ((`D1`.`proximusUnitNrList`))"
- },
- {
- "expr": "cover ((`D1`.`proximusObjectName`))"
- },
- {
- "expr": "cover ((`D1`.`proximusObjectNrList`))"
- },
- {
- "expr": "cover ((`D1`.`errorCodeName`))"
- },
- {
- "expr": "cover ((`D1`.`responsibleParties`))"
- },
- {
- "expr": "cover ((`D1`.`remedyStates`))"
- },
- {
- "expr": "cover ((`D1`.`inspectionObjectID`))"
- },
- {
- "expr": "cover ((`D1`.`inspectionObjectTypeName`))"
- },
- {
- "expr": "cover ((`D1`.`inspectionObjectNumber`))"
- },
- {
- "expr": "cover ((`D1`.`specialCircumstanceName`))"
- },
- {
- "expr": "cover ((`D1`.`specialCircumstanceAcronym`))"
- },
- {
- "expr": "cover ((`D1`.`selfRegulationID`))"
- },
- {
- "expr": "cover ((`D1`.`selfRegulationTypeName`))"
- },
- {
- "expr": "cover ((`D1`.`photoIDs`))"
- }
- ]
- },
- {
- "#operator": "FinalProject"
- }
- ]
- }
- }
- ]
- },
- "text": "SELECT meta().id, type, projectID, sinceEpoch, updatedAt, spaceCategoryName, spaceName, spaceNrList, unitName, unitNrList, objectName, objectNrList, detailName, detailNrList, proximusUnitName, proximusUnitNrList, proximusObjectName, proximusObjectNrList, errorCodeName, responsibleParties, remedyStates, inspectionObjectID, inspectionObjectTypeName, inspectionObjectNumber, specialCircumstanceName, specialCircumstanceAcronym, selfRegulationID, selfRegulationTypeName, photoIDs FROM `ispect` as D1 USE INDEX (`issue_filter_index` USING GSI) LET state = (SELECT RAW MAX([S1.inspectionNumber,S1])[1] FROM D1.remedyStates AS S1)[0], docId = SUBSTR(meta(D1).id, 0, 5) WHERE type = 'defect' AND projectID = 'project_1503412693_b208a02b-ce84-438a-bdf9-3e3ab28edd08' AND docId != '_sync' AND (isDeleted is not valued OR isDeleted == false) AND state.isRemedied = false AND (state.remedyStatus IS NOT VALUED OR state.remedyStatus[0].taggedAsRemediedBySubcontractor = false)"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement