问题一:PolarDB这个审计是免费的吗?
PolarDB这个审计是免费的吗?
参考回答:
PolarDB的审计功能不是免费的,开启后会产生额外费用。
PolarDB是阿里云提供的一种云原生关系型数据库服务,它具备高性能、高可用性和高扩展性的特点。其中,SQL审计是一项重要的安全功能,用于记录数据库操作的详细信息,以便于事后分析和审计。但是这项功能默认是关闭的,用户需要手动开启。一旦开启,将根据审计日志存储的容量收取费用,价格为0.012元/小时/GB。这些费用是按量扣费的,不支持包年包月的计费方式。
此外,如果用户不再需要审计功能,可以在PolarDB-X控制台关闭它。关闭后,系统将不再写入新的审计数据,但用户仍然可以查看之前的历史数据。需要注意的是,这部分历史数据也会产生存储和索引费用。
总之,在使用PolarDB时,了解各项功能的费用对于控制成本非常重要。建议在启用任何可能产生费用的功能之前,先详细阅读相关的计费说明和条款,以避免不必要的开支。
关于本问题的更多回答可点击原文查看:
https://developer.aliyun.com/ask/595358
问题二:PolarDB新用户使用最新的数据库代理2.8.28和数据库内核8.0.2.2.13的用户多吗?
PolarDB新用户使用最新的数据库代理2.8.28和数据库内核8.0.2.2.13的用户多吗?有啥反馈的问题暂时无法处理的吗?
参考回答:
代理可以升级的稳定版本都是比较稳定的,我们新的改动较大的版本只有新购才能购到,升级的都是优先使用bugfix的稳定版本。
关于本问题的更多回答可点击原文查看:
https://developer.aliyun.com/ask/595357
问题三:PolarDB2.8.25到2.8.28中间这几个版本改了什么呢?
数据库代理最新版本2.8.28,而帮助文档里发布日志只有2.8.25以下版本发布日志,PolarDB2.8.25到2.8.28中间这几个版本改了什么呢?
参考回答:
让文档同学补充了。
关于本问题的更多回答可点击原文查看:
https://developer.aliyun.com/ask/595356
问题四:PolarDB这两个最新版是否属于稳定版?
PolarDB这两个最新版是否属于稳定版?
参考回答:
是的。
关于本问题的更多回答可点击原文查看:
https://developer.aliyun.com/ask/595354
问题五:在PolarDB这样的sql能优化么?
在PolarDB这样的sql能优化么?
select from
( select a.id as id, a.num_site as numSite, a.seller_code as sellerCode, a.seller_short as sellerShort,
a.id_seller as idSeller, a.type as type, a.portfolio_id as portfolioId, a.portfolio_name as portfolioName,
a.campaign_id as campaignId, a.campaign_type as campaignType, a.name
as name
, a.state as state,
a.targeting_type as targetingType, a.start_date as startDate, a.end_date as endDate, a.strategy as strategy,
a.budget as budget, a.suggested_budget as suggestedBudget, a.budget_type as budgetType, a.effective_budget as effectiveBudget,
a.last_update_date_time as lastUpdateDateTime, a.serving_status as servingStatus, a.creation_date_time as creationDateTime,
a.usage_updated_timestamp as usageUpdatedTimestamp, a.placement_bidding as placementBidding, a.del_flag as delFlag,
a.create_by as createBy, a.create_name as createName, a.create_time as createTime, a.update_time as updateTime,
a.update_by as updateBy, a.update_name as updateName, a.cost_type as costType, a.bid_optimization as bidOptimization ,
b., c.* from ams_campaign a
inner join (
select campaign_id as campaign_id, group_concat(distinct id_ad_user) as idAdUserList,
group_concat(distinct id_practice) as idPracticeList,
group_concat(distinct ad_user_name) as adUserNameList, group_concat(distinct practice_user_name) as practiceUserNameList
from ams_data_auth WHERE 1=1
and (
id_ad_user in ( 1562393201367879680 )
or id_practice in ( 1562393201367879680 ) )
group by campaign_id ) b
on a.campaign_id = b.campaign_id
left join (
select campaignId as rCampaignId, round(max(topOfSearchImpressionShare + 0), 4) as topOfSearchImpressionShare,
round(sum(impressions + 0), 0) as impressions, round(sum(clicks + 0), 0) as clicks,
round(sum(clicks + 0) / sum(impressions + 0), 4) as ctr, round(sum(cost + 0) / sum(clicks + 0), 2) as cpc,
round(sum(cost + 0), 2) as cost, round(sum(sales14d + 0), 2) as sales, round(sum(cost + 0) / sum(sales14d + 0), 4) as acos,
round(sum(sales14d + 0) / sum(cost + 0), 2) as roas, round(sum(purchases14d + 0), 0) as orderNums,
round(sum(purchasesSameSku14d + 0), 0) as orderNumsSame, round(sum(purchasesOtherSku14d + 0), 0) as orderNumsOther,
round(sum(spend + 0) / sum(purchases14d + 0), 2) as cpa, round(sum(purchases14d + 0) / sum(clicks + 0), 4) as cvr,
round(sum(unitsSoldClicks14d + 0), 0) as unitsSold, round(sum(viewableImpressions + 0) / sum(impressions + 0), 4) as vtr,
round(sum(viewableImpressions + 0) / sum(clicks + 0), 4) as vctr, round(sum(attributedOrdersNewToBrand14d + 0), 0) as brandNewBuyerOrderNums,
round(sum(attributedOrdersNewToBrand14d + 0) / sum(clicks + 0), 4) as brandNewBuyerOrderRate,
round(sum(attributedSalesNewToBrand14d + 0), 0) as brandNewBuyerSales, round(sum(attributedUnitsOrderedNewToBrand14d + 0), 0) as brandNewBuyerUnitsOrdered,
round(sum(video5SecondViews + 0), 0) as video5SecondViews, round(sum(video5SecondViews + 0) / sum(viewableImpressions + 0), 4) as video5SecondViewRate,
round(sum(videoFirstQuartileViews + 0), 0) as videoFirstQuartileViews, round(sum(videoMidpointViews + 0), 0) as videoMidpointViews,
round(sum(videoThirdQuartileViews + 0), 0) as videoThirdQuartileViews, round(sum(videoCompleteViews + 0), 0) as videoCompleteViews,
round(sum(videoUnmutes + 0), 0) as videoUnmutes, round(sum(attributedBrandedSearches14d + 0), 0) as brandSearches,
round(sum(cumulativeReach + 0), 0) as cumulativeReach, round(sum(impressionsFrequencyAverage + 0), 0) as impressionsFrequencyAverage
from ams_sp_campaign
WHERE 1=1
and report_category = 'SPONSORED_PRODUCTS'
and date
between '2024-01-21' and '2024-01-21' group by campaignId ) c
on a.campaign_id = c.rCampaignId
WHERE 1=1
and a.del_flag = 0
and a.type = 'SPONSORED_PRODUCTS'
and a.serving_status != 'CAMPAIGN_INCOMPLETE'
and a.num_site in ( 7 ) ) a order by a.id desc limit 0,10
参考回答:
这个SQL查询看起来已经相当优化了。它使用了多个子查询和连接操作,以及聚合函数和条件过滤来获取所需的数据。以下是一些可能的优化建议:
- 索引优化:确保在相关表上创建适当的索引,以加速查询速度。例如,可以在
ams_campaign
表上的campaign_id
、del_flag
、type
、serving_status
和num_site
字段上创建索引。同样,在ams_data_auth
表上的campaign_id
、id_ad_user
和id_practice
字段上创建索引。最后,在ams_sp_campaign
表上的report_category
、date
和campaignId
字段上创建索引。 - 减少子查询:尽量减少子查询的使用,因为它们可能会导致性能下降。在这个查询中,可以考虑将部分子查询合并到主查询中,或者使用临时表来存储中间结果。
- 避免全表扫描:尽量避免在查询中使用全表扫描,因为这会导致性能下降。可以通过添加适当的索引和使用更精确的过滤条件来避免全表扫描。
- 限制返回的数据量:尽量只返回所需的数据,而不是返回整个表的所有列。在这个查询中,可以通过仅选择需要的列来减少数据传输量。
- 使用并行查询:如果数据库支持并行查询,可以尝试启用并行查询来提高查询性能。这可以通过设置适当的并行度参数来实现。
请注意,这些优化建议可能需要根据实际数据模型和查询需求进行调整。在进行任何优化之前,请务必备份数据并在测试环境中进行测试,以确保优化后的查询仍然正确且性能得到提升。
关于本问题的更多回答可点击原文查看: