2009年6月10日星期三

mysql取随机 order by rand()

当随便看看成为在各个页面的应用中出现后,order by rand()越来越多的出现后台sql中.
首先看看这条sql的作用
EXPLAIN SELECT * FROM TABLE ORDER BY rand( ) LIMIT 1

从表TABLE中随机的取出一行
做explain 后为

1 SIMPLE table ALL NULL NULL NULL NULL 607 Using temporary; Using filesort

建立临时表,并做文件排序,最后取一行,这个事得不偿失

2009年2月10日星期二

svn不支持http

新编译的svn不支持http

svn: Unrecognized URL scheme

需要安装neno
neon-0.28.3.tar.gz
把neno解压后重命名为neno,放入subversion的代码的顶级目录下重新config && make && make install
支持 http的svn客户端表现如下

[dba@mysqldba ~]# svn --version
svn, version 1.5.5 (r34862)
compiled Feb 10 2009, 17:58:37

Copyright (C) 2000-2008 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
- handles 'http' scheme

* ra_svn : Module for accessing a repository using the svn network protocol.
- with Cyrus SASL authentication
- handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme


所以安装ra_neno就可以支持http

2009年1月12日星期一

bazaar安装问题

mysql的源码库更换了版本控制工具,使用了bazaar
好不容易把bazaar的源码找到,编译时,出现下面错误
Failed to build "bzrlib._btree_serializer_c".
Use --allow-python-fallback to use slower python implementations instead.
这样,需要在编译中添加--allow-python-fallback
如下
python setup.py install build_ext --allow-python-fallback
参考:https://bugs.launchpad.net/bzr/+bug/295826