我有兩個表工具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