建议7.5 - 建议7.7

建议7.5:在返回的结果集大于1行时,不建议使用嵌套循环连接,应考虑使用哈希连接或排序合并连接进行替换。

&说明

返回大量结果集时嵌套循环连接的成本较高、效率很低,此时应考虑变换连接方式,特别在使用RBO优化器时,嵌套循环连接的优先级较高,通常需要用“提示”来强制改变连接方式。

建议7.6:两个无序大表的连接,在连接字段无索引时,不建议使用合并排序连接。

&说明

排序合并连接需要先对两个表按连接字段进行排序,如果两个表都非常大,其排序的操作的代价会非常巨大。

建议7.7:含有多表的SQL语句,必须明确指定各表的连接条件,以避免产生迪卡尔积。

--明确所有表的连接条件
select a.column2, b.column2, c.column2
  from t_tablename1 a, t_tablename2 b, t_tablename3 c
 where a.column1 = b.column1
   and b.column1 = c.column1
   and c.column1 <> value;

<template> <view> <view class="btn-container"> <button class="time-btn" @click="updateChart(7)">近7天</button> <button class="time-btn" @click="updateChart(15)">近15天</button> <button class="time-btn" @click="updateChart(30)">近30天</button> </view> <view style="width:650rpx; height:400rpx"> <l-echart ref="chartRef" @finished="init"></l-echart> </view> </view> </template> <script> import * as echarts from '@/uni_modules/lime-echart/static/echarts.min' export default { data() { return { chart: null, baseDates: ['7.1', '7.2', '7.3', '7.4', '7.5', '7.6', '7.7'], option: { xAxis: { type: 'category', data: [], axisLabel: { rotate: 45 } }, yAxis: { type: 'value', min: 0.2, max: 1, interval: 0.2, axisLabel: { formatter: value => value === 1 ? `${value}w` : value } }, series: [{ type: 'line', smooth: true, symbol: 'circle', symbolSize: 8, lineStyle: { width: 2 }, areaStyle: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, color: 'rgba(64, 158, 255, 0.4)' }, { offset: 1, color: 'rgba(64, 158, 255, 0.01)' } ]) }, data: [] }], tooltip: { trigger: 'axis', formatter: params => `${params[0].name} ${params[0].value}w` }, grid: { left: '3%', right: '4%', bottom: '15%', containLabel: true } } } }, methods: { async init() { this.chart = await this.$refs.chartRef.init(echarts) this.updateChart(7) // 初始化显示7天数据 }, generateData(days) { const dates = this.baseDates.slice(0, days) const values = [] for (let i = 0; i < days; i++) { values.push(+(Math.random() * 0.8 + 0.2).t
03-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值