数据操作有关问题

WBOY
Release: 2016-06-13 13:22:53
Original
807 people have browsed it

数据操作问题
我目前有4张表,需要显示其中的某几个字段到页面表格中,我现在不想用left join ,我想分成4条sql来查询,然后进行组合
但是这么做会出现一个问题:搜索4张表中的某几个字段,或者对字段排序,分页,这些操作会让我的这种做饭变复杂,请问怎么才能优化这些操作

还是有其他解决方法,left join效率有些低即使加了索引,在不使用left join的情况下,怎么把这些字段放到页面表格中,并且能很方便的分页,排序,搜索!

------解决方案--------------------

探讨
我目前有4张表,需要显示其中的某几个字段到页面表格中,我现在不想用left join ,我想分成4条sql来查询,然后进行组合
但是这么做会出现一个问题:搜索4张表中的某几个字段,或者对字段排序,分页,这些操作会让我的这种做饭变复杂,请问怎么才能优化这些操作

还是有其他解决方法,left join效率有些低即使加了索引,在不使用left join的情况下,怎么把这些字段放到页面表格中,并且……

------解决方案--------------------
把字段集成到一个表中,呵呵
好好建索引不会慢到哪儿去的,只要一切规划合理的话
你必需得知道mysql有很多限制,就连索引也不是为所欲为
你对各表字段正常分类太苛刻,跨四个表,还不想联合,还嫌索引慢
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!