id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	due_date
107	寻找丢失的数据——建商品全量索引时数据丢失的问题	huangzhong	huangzhong	"* 现象
在测试商城搜索时发现产品页面上显示某种产品有多少个商家报价，但点进去看确发现没有这么多商家

* 分析
在对建索引sql语句进行分析执行之后发现，数据库中确实是有这么多商家报价的，但为什么在索引中会少呢，难道是写索引的时候报错了，把建索引sql加上product_id条件，只写这个出问题的产品索引，发现一切正常。写索引的时候是按照10万数据来做分页的，难道是分页算法有误，测试了之后发现分页算法也没问题。最后发现是因为建索引sql语句没有指定order by，所以分页的时候是数据是不确定的。

* 解决方案
对建索引sql加上指定order by字段

* 延伸
对postgresql作分页的时候，最好是加上order by，不然出来的数据很可能不是你想要的

"	defect	closed	major	2012年6.0版本	系统相关	6.0	fixed	索引,数据库迁移		12/06/2012
