mySQL查询主表出现延迟状况怎么处理

mySQL查询主表出现延迟状况怎么处理

来源:爱站网
时间:2022-05-04
编辑:网友分享
你知道mySQL查询主表出现延迟状况怎么处理比较好吗?带着这个问题,爱站技术频道小编整理了以下相关资料,如果你感兴趣的话可以参考下,希望能帮助到你。

例:

复制代码 代码如下:
<hibernate-mapping>

<class name=”com.pojo.Sortp” table=”sortp” catalog=”shjdc”>

<id name=”id” type=”java.lang.Integer”>

<column name=”Id” />

<generator class=”assigned” />

</id>

<property name=”name” type=”java.lang.String”>

<column name=”Name” length=”40″ not-null=”true” />

</property>

<set name=”productses” inverse=”true” cascade=”all” lazy=”true”>

<key>

<column name=”Sortid” not-null=”true” />

</key>

<one-to-many class=”com.pojo.Products” />

</set>

</class>

</hibernate-mapping>

一般情况下就是把lazy设为true,而不是false,因为,假如设为false的话,在执行查询主表的同时,相应的子表也会查询,添加了许多无用功。

了解完mySQL查询主表出现延迟状况怎么处理的内容后,小伙伴们都知道怎么操作这类问题了吧!喜欢可以收藏我们爱站技术频道网站,我们每天都会更新文章。