sphinx
结构图:
安装sphinx软件
如何搜索包含北京的记录?
Select * from news where content like ‘%北京%’
这样有什么弊端?
1.不走索引,特别慢
如果是100万条记录?如果是1000万条记录?
2.搜索不准确,只能搜标题
Sphinx原理,如果搜索北京
Sphinx临时文件,特别快
i...
分类:
其他好文 时间:
2015-05-09 13:28:11
阅读次数:
93
原文:Mysql学习笔记(十)存储过程与函数 + 知识点补充(having与where的区别)学习内容:存储程序与函数。。。这一章学的我是云里雾里的。。。 1.存储过程。。。 Mysql存储过程是从mysql 5.0开始增加的一个新功能.存储过程的优点其实有很多,不过我觉得存储过程最重要的优点就是实...
分类:
数据库 时间:
2015-05-09 13:09:46
阅读次数:
200
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
基本思路:
中序遍历的过程,与有序链表的顺序是一一对应的。
采用中序遍历构造进树的构造。
并利用取值范围,确定,根的位置,以及子树的范围。
故需要遍历整个链表,求...
分类:
其他好文 时间:
2015-05-09 11:43:53
阅读次数:
140
$list = $Data->join('w_read ON w_article.id = w_read.aid')->where($where)->order($order)->limit($Page->firstRow.','.$Page->listRows)->select();调用由于w_r...
分类:
数据库 时间:
2015-05-09 11:40:13
阅读次数:
147
忘记MySql密码:
编辑mysql主配置文件 my.cnf 在[mysqld]字段下添加参数 skip-grant
重启数据库服务,这样就可以进入数据库不用授权了 mysql -uroot
修改相应用户密码 use mysql;
update user setpassword=password('密码') where user='r...
分类:
数据库 时间:
2015-05-09 10:22:04
阅读次数:
217
Given a range [m, n] where 0
For example, given the range [5, 7], you should return 4.
这题如果按照题意做会超时,用移位的操作很妙,因为是并操作,其实只要最小的数和最大的数从左往右取相同的位即可。遇到不同就退出,因为他们中间肯定有数该为为0。
class Solution {
public:
...
分类:
其他好文 时间:
2015-05-09 06:35:16
阅读次数:
109
Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjace...
分类:
其他好文 时间:
2015-05-09 06:30:14
阅读次数:
100
好累,加班到现在,但是其实你的负责的工作都已经做完了。可是还需要配合别人,只能等!!! 现在已经凌晨了。。。
工作分配不够好?个人不负责?时间规划不好?
不知道!!!
说入正题,这是问题原型:
SQL 慢的:
select * from MyTable where InputTime>'2015-05-09'
SQL 快的:
Declare @t datetime
set @...
分类:
其他好文 时间:
2015-05-09 01:23:43
阅读次数:
156
Givennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histog...
分类:
其他好文 时间:
2015-05-09 01:13:01
阅读次数:
169
1.动态SQl简介 使用动态SQL元素与JSTL相似,它允许我们在XML中构建不同的SQL语句。常用的元素如下 判断元素:if,choose 关键字元素:where,set,trim 循环元素:foreach2.if元素是简单的条件判断逻辑,满足指定条件时追加if元素内的SQL,不满足条件时不...
分类:
编程语言 时间:
2015-05-08 23:47:34
阅读次数:
135