我有两个表工具tool_attribute。 工具具有12列和tool_attribute具有5.关于内部连接的sqlite优化,表值大约18K
信息我需要从表中:
- 工具 - REFID,串行,类型,识别符
- tool_attribute - 键,值,ID(有将这种多个条目)
现在,我有tool_attribute刀具围绕18264和255696
当前查询:
select
tool.refid,
tool.serial,
tool_attribute.value,
tool.type
from tool
inner join tool_attribute
on tool.id = tool_attribute.id
where
(tool_attribute.val LIKE '%t00%' or
tool.serial LIKE '%t00%')
group by tool.refid
order by tool.serial asc;
这需要大约750毫秒是相当快的,但我想使它更快。我在低内存Windows 6.0设备上运行此代码,因此需要太多时间。 有什么办法可以让它变得更快?
这是什么't00'?如果它是一个重要的信息,它可能是值得把它放在自己的专栏。 –
没有它的只是一个示例文本。它可能会有所不同 – user3383301