Explain Plan for Simple Query
[{
"plan": {
"~children": [{
"scan": {
"index_id": "163c2a6dc3e4bd34",
"index": "contentTag_experienceId",
"using": "gsi",
"#operator": "IndexScan",
"spans": [{
"Range": {
"High": ["null"],
"Inclusion": 3,
"Low": ["null"]
}
}, {
"Range": {
"High": ["\"experience:com.samsung.sea.retailagent.hero2.b2c\""],
"Inclusion": 3,
"Low": ["\"experience:com.samsung.sea.retailagent.hero2.b2c\""]
}
}, {
"Range": {
"High": ["\"experience:experience:allsamsungexperience:20161128182943284\""],
"Inclusion": 3,
"Low": ["\"experience:experience:allsamsungexperience:20161128182943284\""]
}
}, {
"Range": {
"High": ["\"experience:experience:allsamsungexperience:20161128192431892\""],
"Inclusion": 3,
"Low": ["\"experience:experience:allsamsungexperience:20161128192431892\""]
}
}, {
"Range": {
"High": ["\"experience:experience:allsamsungexperience:20161128193621041\""],
"Inclusion": 3,
"Low": ["\"experience:experience:allsamsungexperience:20161128193621041\""]
}
}, {
"Range": {
"High": ["\"experience:experience:allsamsungexperience:20161128205022801\""],
"Inclusion": 3,
"Low": ["\"experience:experience:allsamsungexperience:20161128205022801\""]
}
}, {
"Range": {
"High": ["\"experience:experience:allsamsungexperience:20161128205825876\""],
"Inclusion": 3,
"Low": ["\"experience:experience:allsamsungexperience:20161128205825876\""]
}
}, {
"Range": {
"High": ["\"experience:experience:allsamsungexperience:20161129145921028\""],
"Inclusion": 3,
"Low": ["\"experience:experience:allsamsungexperience:20161129145921028\""]
}
}, {
"Range": {
"High": ["\"experience:experience:com.samsung.sea.retailagent.hero2.b2c:20160630215123487\""],
"Inclusion": 3,
"Low": ["\"experience:experience:com.samsung.sea.retailagent.hero2.b2c:20160630215123487\""]
}
}],
"keyspace": "retailcloudPortalDev",
"namespace": "default"
},
"#operator": "DistinctScan"
}, {
"#operator": "Parallel",
"~child": {
"~children": [{
"as": "contentTag",
"#operator": "Fetch",
"keyspace": "retailcloudPortalDev",
"namespace": "default"
}, {
"as": "content",
"on_keys": "(`contentTag`.`contentId`)",
"#operator": "Join",
"keyspace": "retailcloudPortalDev",
"namespace": "default"
}, {
"condition": "((((((((((((`contentTag`.`docType`) = \"contenttag\") and ((`content`.`docType`) = \"content\")) and (((`content`.`validityStartDate`) is not valued) or (date_diff_str(((((substr((`content`.`validityStartDate`), 8, 4) || \"-\") || case when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"jan\") then \"01\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"feb\") then \"02\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"mar\") then \"03\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"apr\") then \"04\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"may\") then \"05\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"jun\") then \"06\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"jul\") then \"07\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"aug\") then \"08\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"sep\") then \"09\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"oct\") then \"10\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"nov\") then \"11\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"dec\") then \"12\" end) || \"-\") || substr((`content`.`validityStartDate`), 4, 2)), date_add_str(now_str(\"0000-01-01\"), 2, \"day\"), \"day\") <= 0))) and (((`content`.`validityEndDate`) is not valued) or (0 <= date_diff_str(((((substr((`content`.`validityEndDate`), 8, 4) || \"-\") || case when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"jan\") then \"01\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"feb\") then \"02\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"mar\") then \"03\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"apr\") then \"04\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"may\") then \"05\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"jun\") then \"06\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"jul\") then \"07\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"aug\") then \"08\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"sep\") then \"09\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"oct\") then \"10\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"nov\") then \"11\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"dec\") then \"12\" end) || \"-\") || substr((`content`.`validityEndDate`), 4, 2)), date_add_str(now_str(\"0000-01-01\"), (-2), \"day\"), \"day\")))) and ((((`contentTag`.`experienceId`) is null) or ((`contentTag`.`experienceId`) = \"experience:com.samsung.sea.retailagent.hero2.b2c\")) or ((`contentTag`.`experienceId`) in [\"experience:experience:com.samsung.sea.retailagent.hero2.b2c:20160630215123487\", \"experience:experience:allsamsungexperience:20161128182943284\", \"experience:experience:allsamsungexperience:20161128192431892\", \"experience:experience:allsamsungexperience:20161128193621041\", \"experience:experience:allsamsungexperience:20161128205022801\", \"experience:experience:allsamsungexperience:20161128205825876\", \"experience:experience:allsamsungexperience:20161129145921028\"]))) and ((\"all\" in (`contentTag`.`supportedCarrierIds`)) or every `carrierId` in [\"carrier:spr\"] satisfies (`carrierId` in (`contentTag`.`supportedCarrierIds`)) end)) and (not any `carrierId` in [\"carrier:spr\"] satisfies (`carrierId` in (`contentTag`.`excludedCarrierIds`)) end)) and ((((\"all\" in (`contentTag`.`supportedChannelIds`)) or any `channelId` in (`contentTag`.`supportedChannelIds`) satisfies ((`channelId` = \"channel:bestbuy\") or contains(\"channel:bestbuy\", (`channelId` || \"\\u003e\"))) end) and (not any `channelId` in (`contentTag`.`excludedChannelIds`) satisfies ((`channelId` = \"channel:bestbuy\") or contains(\"channel:bestbuy\", (`channelId` || \"\\u003e\"))) end)) or any `channelId` in (`contentTag`.`supportedChannelIds`) satisfies (`channelId` = \"channel:bestbuy\") end)) and ((\"all\" in (`contentTag`.`supportedDeviceCodeIds`)) or (any `deviceCodeId` in (`contentTag`.`supportedDeviceCodeIds`) satisfies ((`deviceCodeId` = \"devicecode:devicetype:mobile:hero2\") or (`deviceCodeId` = \"devicetype:mobile\")) end and (not any `deviceCodeId` in [\"devicecode:devicetype:mobile:hero2\"] satisfies (`deviceCodeId` in (`contentTag`.`excludedDeviceCodeIds`)) end)))) and ((((`contentTag`.`supportedStoreSetIds`) is not valued) or (\"all\" in (`contentTag`.`supportedStoreSetIds`))) or every `storeSetId` in [\"storeset:none\"] satisfies (`storeSetId` in (`contentTag`.`supportedStoreSetIds`)) end)) and (not any `storeSetId` in [\"storeset:none\"] satisfies (`storeSetId` in (`contentTag`.`excludedStoreSetIds`)) end))",
"#operator": "Filter"
}, {
"result_terms": [{
"expr": "(`contentTag`.`experienceId`)"
}, {
"expr": "(`content`.`contentId`)"
}, {
"expr": "(`content`.`contentName`)"
}, {
"expr": "(`content`.`contentCategoryIds`)"
}, {
"expr": "(`content`.`md5`)"
}, {
"expr": "(`content`.`version`)"
}, {
"expr": "(`content`.`mimeType`)"
}, {
"expr": "(`content`.`size`)"
}, {
"expr": "(`content`.`priority`)"
}, {
"expr": "(`content`.`destinationPath`)"
}, {
"expr": "(`contentTag`.`supportedCarrierIds`)"
}, {
"expr": "(`contentTag`.`excludedCarrierIds`)"
}, {
"expr": "(`contentTag`.`supportedChannelIds`)"
}, {
"expr": "(`contentTag`.`excludedChannelIds`)"
}],
"#operator": "InitialProject"
}, {
"#operator": "FinalProject"
}],
"#operator": "Sequence"
}
}],
"#operator": "Sequence"
},
"text": "select contentTag.experienceId, content.contentId, content.contentName, content.contentCategoryIds, content.md5, content.version, content.mimeType, content.size, content.priority, content.destinationPath, contentTag.supportedCarrierIds, contentTag.excludedCarrierIds, contentTag.supportedChannelIds, contentTag.excludedChannelIds from retailcloudPortalDev contentTag use index(contentTag_experienceId) inner join retailcloudPortalDev content on keys contentTag.contentId where contentTag.docType='contenttag' and content.docType='content' and (content.validityStartDate is not valued or DATE_DIFF_STR(SUBSTR(content.validityStartDate,8,4)||'-'||CASE WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='jan' THEN '01' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='feb' THEN '02' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='mar' THEN '03' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='apr' THEN '04' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='may' THEN '05' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='jun' THEN '06' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='jul' THEN '07' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='aug' THEN '08' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='sep' THEN '09' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='oct' THEN '10' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='nov' THEN '11' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='dec' THEN '12' END||'-'||SUBSTR(content.validityStartDate,4,2), date_add_str(NOW_STR('0000-01-01'), 2, 'day'), 'day')<=0) and (content.validityEndDate is not valued or DATE_DIFF_STR(SUBSTR(content.validityEndDate,8,4)||'-'||CASE WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='jan' THEN '01' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='feb' THEN '02' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='mar' THEN '03' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='apr' THEN '04' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='may' THEN '05' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='jun' THEN '06' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='jul' THEN '07' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='aug' THEN '08' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='sep' THEN '09' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='oct' THEN '10' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='nov' THEN '11' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='dec' THEN '12' END||'-'||SUBSTR(content.validityEndDate,4,2), date_add_str(NOW_STR('0000-01-01'), -2, 'day'), 'day')>=0) and (contentTag.experienceId is null or contentTag.experienceId='experience:com.samsung.sea.retailagent.hero2.b2c' or contentTag.experienceId in ["experience:experience:com.samsung.sea.retailagent.hero2.b2c:20160630215123487","experience:experience:allsamsungexperience:20161128182943284","experience:experience:allsamsungexperience:20161128192431892","experience:experience:allsamsungexperience:20161128193621041","experience:experience:allsamsungexperience:20161128205022801","experience:experience:allsamsungexperience:20161128205825876","experience:experience:allsamsungexperience:20161129145921028"]) and ('all' in contentTag.supportedCarrierIds or every carrierId in ["carrier:spr"] satisfies carrierId in contentTag.supportedCarrierIds end) and not(any carrierId in ["carrier:spr"] satisfies carrierId in contentTag.excludedCarrierIds end) and ((('all' in contentTag.supportedChannelIds or (any channelId in contentTag.supportedChannelIds satisfies channelId='channel:bestbuy' or contains('channel:bestbuy', channelId || '>') end)) and not(any channelId in contentTag.excludedChannelIds satisfies channelId='channel:bestbuy' or contains('channel:bestbuy', channelId || '>') end)) or (any channelId in contentTag.supportedChannelIds satisfies channelId='channel:bestbuy' end)) and ('all' in contentTag.supportedDeviceCodeIds or (any deviceCodeId in contentTag.supportedDeviceCodeIds satisfies deviceCodeId='devicecode:devicetype:mobile:hero2' or deviceCodeId='devicetype:mobile' end and not(any deviceCodeId in ["devicecode:devicetype:mobile:hero2"] satisfies deviceCodeId in contentTag.excludedDeviceCodeIds end))) and (contentTag.supportedStoreSetIds is not valued or 'all' in contentTag.supportedStoreSetIds or every storeSetId in ["storeset:none"] satisfies storeSetId in contentTag.supportedStoreSetIds end) and not(any storeSetId in ["storeset:none"] satisfies storeSetId in contentTag.excludedStoreSetIds end)"
Explain Plan for Parameterized Query
[{
"plan": {
"~children": [{
"scan": {
"index_id": "163c2a6dc3e4bd34",
"index": "contentTag_experienceId",
"using": "gsi",
"#operator": "IndexScan",
"spans": [{
"Range": {
"High": ["null"],
"Inclusion": 3,
"Low": ["null"]
}
}, {
"Range": {
"High": ["$parentExperienceId"],
"Inclusion": 3,
"Low": ["$parentExperienceId"]
}
}, {
"Range": {
"Low": ["null"],
"Inclusion": 0
}
}],
"keyspace": "retailcloudPortalDev",
"namespace": "default"
},
"#operator": "DistinctScan"
}, {
"#operator": "Parallel",
"~child": {
"~children": [{
"as": "contentTag",
"#operator": "Fetch",
"keyspace": "retailcloudPortalDev",
"namespace": "default"
}, {
"as": "content",
"on_keys": "(`contentTag`.`contentId`)",
"#operator": "Join",
"keyspace": "retailcloudPortalDev",
"namespace": "default"
}, {
"condition": "((((((((((((`contentTag`.`docType`) = \"contenttag\") and ((`content`.`docType`) = \"content\")) and (((`content`.`validityStartDate`) is not valued) or (date_diff_str(((((substr((`content`.`validityStartDate`), 8, 4) || \"-\") || case when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"jan\") then \"01\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"feb\") then \"02\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"mar\") then \"03\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"apr\") then \"04\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"may\") then \"05\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"jun\") then \"06\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"jul\") then \"07\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"aug\") then \"08\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"sep\") then \"09\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"oct\") then \"10\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"nov\") then \"11\" when (lower(substr((`content`.`validityStartDate`), 0, 3)) = \"dec\") then \"12\" end) || \"-\") || substr((`content`.`validityStartDate`), 4, 2)), date_add_str(now_str(\"0000-01-01\"), 2, \"day\"), \"day\") <= 0))) and (((`content`.`validityEndDate`) is not valued) or (0 <= date_diff_str(((((substr((`content`.`validityEndDate`), 8, 4) || \"-\") || case when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"jan\") then \"01\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"feb\") then \"02\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"mar\") then \"03\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"apr\") then \"04\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"may\") then \"05\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"jun\") then \"06\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"jul\") then \"07\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"aug\") then \"08\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"sep\") then \"09\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"oct\") then \"10\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"nov\") then \"11\" when (lower(substr((`content`.`validityEndDate`), 0, 3)) = \"dec\") then \"12\" end) || \"-\") || substr((`content`.`validityEndDate`), 4, 2)), date_add_str(now_str(\"0000-01-01\"), (-2), \"day\"), \"day\")))) and ((((`contentTag`.`experienceId`) is null) or ((`contentTag`.`experienceId`) = $parentExperienceId)) or ((`contentTag`.`experienceId`) in $experienceIds))) and ((\"all\" in (`contentTag`.`supportedCarrierIds`)) or every `carrierId` in $carrierIds satisfies (`carrierId` in (`contentTag`.`supportedCarrierIds`)) end)) and (not any `carrierId` in $carrierIds satisfies (`carrierId` in (`contentTag`.`excludedCarrierIds`)) end)) and ((((\"all\" in (`contentTag`.`supportedChannelIds`)) or any `channelId` in (`contentTag`.`supportedChannelIds`) satisfies ((`channelId` = $fullChannelCodePath0) or contains($fullChannelCodePath0, (`channelId` || \"\\u003e\"))) end) and (not any `channelId` in (`contentTag`.`excludedChannelIds`) satisfies ((`channelId` = $fullChannelCodePath0) or contains($fullChannelCodePath0, (`channelId` || \"\\u003e\"))) end)) or any `channelId` in (`contentTag`.`supportedChannelIds`) satisfies (`channelId` = $fullChannelCodePath0) end)) and ((\"all\" in (`contentTag`.`supportedDeviceCodeIds`)) or (any `deviceCodeId` in (`contentTag`.`supportedDeviceCodeIds`) satisfies ((`deviceCodeId` = $deviceCodeId0) or (`deviceCodeId` = $deviceTypeId0)) end and (not any `deviceCodeId` in $deviceCodeIds satisfies (`deviceCodeId` in (`contentTag`.`excludedDeviceCodeIds`)) end)))) and ((((`contentTag`.`supportedStoreSetIds`) is not valued) or (\"all\" in (`contentTag`.`supportedStoreSetIds`))) or every `storeSetId` in $storeSetIds satisfies (`storeSetId` in (`contentTag`.`supportedStoreSetIds`)) end)) and (not any `storeSetId` in $storeSetIds satisfies (`storeSetId` in (`contentTag`.`excludedStoreSetIds`)) end))",
"#operator": "Filter"
}, {
"result_terms": [{
"expr": "(`contentTag`.`experienceId`)"
}, {
"expr": "(`content`.`contentId`)"
}, {
"expr": "(`content`.`contentName`)"
}, {
"expr": "(`content`.`contentCategoryIds`)"
}, {
"expr": "(`content`.`md5`)"
}, {
"expr": "(`content`.`version`)"
}, {
"expr": "(`content`.`mimeType`)"
}, {
"expr": "(`content`.`size`)"
}, {
"expr": "(`content`.`priority`)"
}, {
"expr": "(`content`.`destinationPath`)"
}, {
"expr": "(`contentTag`.`supportedCarrierIds`)"
}, {
"expr": "(`contentTag`.`excludedCarrierIds`)"
}, {
"expr": "(`contentTag`.`supportedChannelIds`)"
}, {
"expr": "(`contentTag`.`excludedChannelIds`)"
}],
"#operator": "InitialProject"
}, {
"#operator": "FinalProject"
}],
"#operator": "Sequence"
}
}],
"#operator": "Sequence"
},
"text": "select contentTag.experienceId, content.contentId, content.contentName, content.contentCategoryIds, content.md5, content.version, content.mimeType, content.size, content.priority, content.destinationPath, contentTag.supportedCarrierIds, contentTag.excludedCarrierIds, contentTag.supportedChannelIds, contentTag.excludedChannelIds from retailcloudPortalDev contentTag use index(contentTag_experienceId) inner join retailcloudPortalDev content on keys contentTag.contentId where contentTag.docType='contenttag' and content.docType='content' and (content.validityStartDate is not valued or DATE_DIFF_STR(SUBSTR(content.validityStartDate,8,4)||'-'||CASE WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='jan' THEN '01' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='feb' THEN '02' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='mar' THEN '03' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='apr' THEN '04' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='may' THEN '05' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='jun' THEN '06' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='jul' THEN '07' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='aug' THEN '08' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='sep' THEN '09' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='oct' THEN '10' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='nov' THEN '11' WHEN LOWER(SUBSTR(content.validityStartDate,0,3))=='dec' THEN '12' END||'-'||SUBSTR(content.validityStartDate,4,2), date_add_str(NOW_STR('0000-01-01'), 2, 'day'), 'day')<=0) and (content.validityEndDate is not valued or DATE_DIFF_STR(SUBSTR(content.validityEndDate,8,4)||'-'||CASE WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='jan' THEN '01' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='feb' THEN '02' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='mar' THEN '03' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='apr' THEN '04' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='may' THEN '05' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='jun' THEN '06' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='jul' THEN '07' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='aug' THEN '08' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='sep' THEN '09' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='oct' THEN '10' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='nov' THEN '11' WHEN LOWER(SUBSTR(content.validityEndDate,0,3))=='dec' THEN '12' END||'-'||SUBSTR(content.validityEndDate,4,2), date_add_str(NOW_STR('0000-01-01'), -2, 'day'), 'day')>=0) and (contentTag.experienceId is null or contentTag.experienceId=$parentExperienceId or contentTag.experienceId in $experienceIds) and ('all' in contentTag.supportedCarrierIds or every carrierId in $carrierIds satisfies carrierId in contentTag.supportedCarrierIds end) and not(any carrierId in $carrierIds satisfies carrierId in contentTag.excludedCarrierIds end) and ((('all' in contentTag.supportedChannelIds or (any channelId in contentTag.supportedChannelIds satisfies channelId=$fullChannelCodePath0 or contains($fullChannelCodePath0, channelId || '>') end)) and not(any channelId in contentTag.excludedChannelIds satisfies channelId=$fullChannelCodePath0 or contains($fullChannelCodePath0, channelId || '>') end)) or (any channelId in contentTag.supportedChannelIds satisfies channelId=$fullChannelCodePath0 end)) and ('all' in contentTag.supportedDeviceCodeIds or (any deviceCodeId in contentTag.supportedDeviceCodeIds satisfies deviceCodeId=$deviceCodeId0 or deviceCodeId=$deviceTypeId0 end and not(any deviceCodeId in $deviceCodeIds satisfies deviceCodeId in contentTag.excludedDeviceCodeIds end))) and (contentTag.supportedStoreSetIds is not valued or 'all' in contentTag.supportedStoreSetIds or every storeSetId in $storeSetIds satisfies storeSetId in contentTag.supportedStoreSetIds end) and not(any storeSetId in $storeSetIds satisfies storeSetId in contentTag.excludedStoreSetIds end)"
}]