Re: convert varchar to char

2005-08-13 Thread Chris Elsworth
On Sat, Aug 13, 2005 at 05:37:56PM +0100, Pooly wrote: > Damnit ! > Thanks for pointing it, I forgot these things. > But it's a bit more subtle : [snip] Bah, should have waited another 5 minutes before I bothered posting my last long-winded ramble ;) > ALTER TABLE sessions MODIFY id char(32) NOT

Re: convert varchar to char

2005-08-13 Thread Chris Elsworth
On Sat, Aug 13, 2005 at 04:01:38PM +0100, Pooly wrote: > > ALTER TABLE sessions MODIFY ip char(8) NOT NULL DEFAULT '0'; > ALTER TABLE sessions MODIFY id char(32) NOT NULL DEFAULT ''; Hello, Since you have two varchar columns, I don't think there's any way to convert them both to char without dro

mysqldump feature request

2005-02-14 Thread Chris Elsworth
Hello, I have a feature request for mysqldump that would greatly ease a current task I have; in my replicated setup my master is currently MyISAM (as are most slaves), but I have one slave that is InnoDB for testing. Somehow or other, it's gotten itself out of sync, so I'm in the position of need

Re: slow query, how can i imporve it?

2005-02-12 Thread Chris Elsworth
On Fri, Feb 11, 2005 at 10:45:46AM -0500, [EMAIL PROTECTED] wrote: > Normally I do not reply to myself but I just realized that in my previous > response I confused COUNT(*) (which is slow for InnoDB because it always > does a table scan to resolve the version lock of each and every row) with

Re: match a fulltext search with a "-" dash, can't match if - exist

2004-10-20 Thread Chris Elsworth
On Mon, Oct 18, 2004 at 11:19:55AM +0800, Louie Miranda wrote: > > mysql> select * from fullsearch where match (title,body) against ('018-E'); > Empty set (0.00 sec) > > > it returns an empty set, is it possible to also search with "-" dash? chars? If I remember correctly, you need to pass the

Re: Help! Nasty big table efficiency issues with GROUP BY

2004-07-20 Thread Chris Elsworth
On Tue, Jul 20, 2004 at 10:39:00AM +1000, Lachlan Mulcahy wrote: > > Chris, > > Have you checked your following server configurables: > > sort_buffer_size: > - This is the size of the cache created by _each_ thread that requires > ORDER BY or GROUP BY in a query. > If you are doing a lot of lar

Help! Nasty big table efficiency issues with GROUP BY

2004-07-19 Thread Chris Elsworth
Hello, I wonder if someone could shed some light on a problem that's been bothering me for months. Please bear with me as I explain it.. I have two tables in question: CREATE TABLE `News` ( `FileID` int(8) unsigned NOT NULL auto_increment, `Subject` char(200) NOT NULL default '', `Category

Re: Server Configuration

2004-06-09 Thread Chris Elsworth
On Wed, Jun 09, 2004 at 01:45:49PM +0100, Marvin Wright wrote: > Hi, > > We are about to build some new database servers and I have some questions > which I'd like some advice on. > > The machines we are building have 4 Xeon 2GHz CPU's, 4 x 32GB SCSI disk > using RAID 1+0 (so thats 64GB of storag

Re: mysqldump under cron

2004-06-01 Thread Chris Elsworth
On Tue, Jun 01, 2004 at 09:28:37AM -0400, adam wrote: > > mysqldump --user=root --password= --opt bugs > > $BACKUPDIR$BACKUPSQLFILE > > My problem is that it does not seem to work when the crond calls the script. > The result of the dump is a zero size sql file. Don't you get the output of stde

Re: "merge tables for big log files ?"

2004-05-31 Thread Chris Elsworth
On Mon, May 31, 2004 at 02:03:09PM +0200, Michael Arndt wrote: > > Problem for this variant: merge table has to be dropped and recreated > periodically. > during the short lag interval the log merge table > does not exis

Re: MySQL performance on FreeBSD compared to Linux

2004-05-23 Thread Chris Elsworth
On Sat, May 22, 2004 at 11:25:54PM -0500, mos wrote: > > > >Once I wiped this and tried Linux (both gentoo, with their > >patched-to-the-hilt 2.6.5 kernel, and Debian, with a stock 2.6.6 which > >had just been released by the time I installed) this figure jumped to > >35,000 queries per second. >

Re: MySQL performance on FreeBSD compared to Linux

2004-05-21 Thread Chris Elsworth
On Fri, May 21, 2004 at 05:18:09PM -0600, Sasha Pachev wrote: > > It looks like FreeBSD was using only one CPU from your numbers. Try the > test with only 1 thread and a lot of iterations to avoid the influence of > overhead. I know very little about FreeBSD, but one thing I would check is > if

MySQL performance on FreeBSD compared to Linux

2004-05-21 Thread Chris Elsworth
Forenote: I have no wish to start an OS debate. Hello, I'm in the fortunate position of having a dual 2.8GHz Xeon with 4G of ram and 4 10k SCSI disks (configured in RAID-10) to deploy as a new MySQL server. Since I'm a numbers freak, I've been running super-smack on it for the last few days to s

Re: super-smack on FreeBSD?

2004-05-18 Thread Chris Elsworth
On Tue, May 18, 2004 at 03:46:46AM -0700, JG wrote: > At 11:31 AM 5/18/2004 +0100, you wrote: > >On Mon, May 17, 2004 at 08:43:44PM -0700, JG wrote: > >> > >> Has ANYONE been able to get super-smack-1.2 to compile as-is on FreeBSD? > >> > >> ./configure --with-mysql > >> make > >> make install > >>

Re: super-smack on FreeBSD?

2004-05-18 Thread Chris Elsworth
On Mon, May 17, 2004 at 08:43:44PM -0700, JG wrote: > > Has ANYONE been able to get super-smack-1.2 to compile as-is on FreeBSD? > > ./configure --with-mysql > make > make install > > Without errors? No, it required various code changes. A colleague of mine made the changes, I can probably get

Re: optimization needed

2004-05-11 Thread Chris Elsworth
On Wed, May 05, 2004 at 01:06:45PM -0400, Brent Baisley wrote: > Basically, you can't, it's a limitation of the InnoDB format. If you > change the table type to MyISAM, that query would be almost > instantaneous. But you are probably using InnoDB for a reason, so you > may be stuck if you want a

Re: MERGE tables and concurrent inserts

2004-03-24 Thread Chris Elsworth
On Wed, Mar 24, 2004 at 01:23:53PM +, Chris Elsworth wrote: > > I'm wondering if specifying LOW_PRIORITY disables concurrent inserts > explicitly, so I'll try removing that and see if anything improves, > but in the meantime, if anyone has any advice, please share :)

MERGE tables and concurrent inserts

2004-03-24 Thread Chris Elsworth
Hello, Further to my MERGE table query the other day, I've now put it into action and it seems to be working fine. However I'm noticing that "INSERT LOW_PRIORITY" statements are blocking when there are SELECTs running. Does anyone know if concurrent inserts work with MERGE tables? Are there any c

Re: MERGE table with some packed tables?

2004-03-22 Thread Chris Elsworth
On Mon, Mar 22, 2004 at 01:40:29PM -0600, Dan Nelson wrote: > In the last episode (Mar 22), Chris Elsworth said: > > Now that's all well and good and I'm fairly sure it'll all work, but > > another interesting idea I was wondering over was - can I myisampack >

MERGE table with some packed tables?

2004-03-22 Thread Chris Elsworth
Hello, Just a quick question to see if anyone's tried this and run into any problems, or if it'll even work - I have a *huge* table that's just crashed thanks to FreeBSD panicking, and the repair operation I'm estimating is going to be another 4 hours :( But anyway, I'm pondering over splitting t

InnoDB Hot Backup & new tablespace format

2004-02-07 Thread Chris Elsworth
Hello, Does anyone know if InnoDB Hot Backup supports the new tablespace format being introduced in the latest versions of InnoDB? I'm quite tempted to switch from MyISAM to InnoDB using the new tablespace format, but I'm put off by how inflexible InnoDB files seem to be. I like being able to mov

Re: any ideas about it

2004-02-02 Thread Chris Elsworth
On Mon, Feb 02, 2004 at 07:16:13PM +0530, Nitin Mehta wrote: > Hi all, > > I m looking for any function or a work around to fetch numerical data without its > sign (-10 --> 10, 10 --> 10). Any ideas? ABS() : mysql> select abs(-10); +--+ | abs(-10) | +--+ | 10 | +--

Re: Reset Auto-Incriment?

2004-01-26 Thread Chris Elsworth
On Mon, Jan 26, 2004 at 10:40:02AM -0600, Paul Fine wrote: > I realize that this might be problematic/devastating if you had an AI PK and > did this, however in my case there is no problem as there is no related data > in the database yet lol. > > My question is, how can I reset AI? For example I

Re: find duplicates

2004-01-13 Thread Chris Elsworth
On Tue, Jan 13, 2004 at 02:03:26AM -0500, [EMAIL PROTECTED] wrote: > > select prodid,count(groupid) as cnt from products > where (groupid=65 or groupid=66) > group by imgsml having cnt>1; > > I.e. replacing order by with a having clause. After trying many variations; are > 'order by' and 'hav

Re: Replicating Table Schema

2004-01-01 Thread Chris Elsworth
On Thu, Jan 01, 2004 at 05:42:59PM -0500, Gohaku wrote: > Hi everyone, > I was just curious if there's a shorthand way of replicating a Table > Schema. > I use the following to create a new Table with the same schema. > >create table new_table ( select * from table); > >delete from new_table; CRE

Re: num rows / pages

2003-12-27 Thread Chris Elsworth
On Sat, Dec 27, 2003 at 02:08:08PM +, Abs wrote: > hi > i was trying to group my results 10 per page ($p per > per page). if i use limit, then there's no way of > knowing how many there are left so i can't give page > numbers as: > << first 2 3 4 last >>. perhaps running the query > twice, firs

Re: Help me - please

2003-12-18 Thread Chris Elsworth
On Thu, Dec 18, 2003 at 05:28:30PM -0200, Carlos Andr? Moura de Amorim wrote: > 031217 14:32:34 Warning: setrlimit couldn't increase number of open files > to more than 256 (request: 510) It might be worth putting a "ulimit -n 1024" (or some other decent number) in the rc.d script that starts my

Re: NOT EXISTS

2003-12-15 Thread Chris Elsworth
On Mon, Dec 15, 2003 at 10:59:32AM -, Curley, Thomas wrote: > Guys > > Any idea why this query will not work in 4.0.13 > > select batch_id from BATCH > where NOT EXISTS (select 1 from TXN where TXN.batch_id = BATCH.batch_id) > > You have an error in your SQL syntax near 'EXISTS (select * fro

Re: Questions about indexing

2003-12-15 Thread Chris Elsworth
On Sun, Dec 14, 2003 at 03:53:00PM -0500, Dan Anderson wrote: > > I have a database I'm using for a MMORPG (well, it isn't very > MM because I'm something of a noob), and I have a few questions about > indexing. I am storing world data in a database. In order to keep > everything as

ALTER TABLE .. ORDER BY

2003-12-10 Thread Chris Elsworth
Hello, Just a quickie. Does anyone know if issueing an ALTER TABLE t ORDER BY c is as good as an OPTIMIZE TABLE if I know the order I'll mostly be sorting with? Does the ALTER TABLE operation reclaimed deleted rows, for example? Or should I OPTIMIZE and then ALTER? Cheers :) -- Chris -- MySQL

Re: Delayed Insert Question

2003-12-09 Thread Chris Elsworth
On Tue, Dec 09, 2003 at 02:18:58PM +0100, David Bordas wrote: > > I've read mysql doc sereval times, but i can't find any varaible that > specify when the delayed queue was flushed. Well, I suppose that's because there isn't one. The DELAYED thread handles that by itself. You don't want it too la

Re: Delayed Insert Question

2003-12-09 Thread Chris Elsworth
On Tue, Dec 09, 2003 at 12:17:41PM +0100, David Bordas wrote: > So, i'm using INSERT DELAYED with some good succes. > > But I've got a question. > If i decrease delayed_insert_limit to ten secondes for example, is that mean > that delayed_queue will be flushed every ten secondes ? > Is there an o

Re: string comparison query

2003-12-07 Thread Chris Elsworth
On Sun, Dec 07, 2003 at 12:11:21AM -0500, Alex Khordos wrote: > > I am trying to work out the query to retrieve city name based on the zip > code in the second table. > How can I compare two strings? I tried LIKE in my query but it did not work. Use SUBSTRING to cut down the extended zipcode to 5

Re: 4.1.1. -> WITH QUERY EXPANSION

2003-12-07 Thread Chris Elsworth
On Sun, Dec 07, 2003 at 01:48:08PM +0100, Sergei Golubchik wrote: > > What is WITH QUERY EXPANSION? I found no details in manual. > > Fixed. > "WITH QUERY EXPANSION" is now documented. I'm sorry, but I must be blind. Where is it on http://www.mysql.com/doc/en/Fulltext_Search.html ? Did someone

Re: MySQL installation problem

2003-12-06 Thread Chris Elsworth
On Sat, Dec 06, 2003 at 08:20:57PM +0100, Franz Edler wrote: > > > > Errno 13 is Permission Denied. Is the mysql daemon running with > > sufficient privileges to read the directory and files within it? > > All the database files should be owned by the mysql user, and are > > generally in the mysql

Re: MySQL installation problem

2003-12-06 Thread Chris Elsworth
On Sat, Dec 06, 2003 at 03:52:05PM +0100, Franz Edler wrote: > > The msqld.log file shows: > 031206 15:05:20 mysqld started > 031206 15:05:20 Fatal error: Can't open privilege tables: > Can't find file: './mysql/host.frm' (errno: 13) > 031206 15:05:20 Aborting > 031206 1

Re: Optimization on query with WHERE, GROUP BY and ORDER BY

2003-12-05 Thread Chris Elsworth
Hello, On Fri, Dec 05, 2003 at 12:02:05PM +0100, Martin Gillstr?m wrote: > > The table can look something like this: > row_id INT PRIMARY KEY > where_column SET('a','b','c') > groupby_column VARCHAR(255) > orderby_column DATE > .. more rows that I need to fetch with the select. > This is what I

DELETE on a huge table; how long *should* it take?

2003-12-05 Thread Chris Elsworth
Hello, I have quite a large table, 45 million rows, which has 3 indexes on it. The rows are evenly distributed across one particular index, which records the time the row was inserted. At any given time there's between 20 and 21 days worth of rows, and every night I delete anything over 20 days. S

Repeated 100% CPU problem in FreeBSD

2003-11-27 Thread Chris Elsworth
Hello, Most of the time, MySQL 4.0.16 runs absolutely fine on my FreeBSD 4.9 system. However, today, unexplicably, it's run into the same problem 3 times now; a couple of the threads suddenly start eating 100% CPU for no good reason while doing a SELECT. They'll sit there until I kill them, which

Re: Unique Index efficiency query

2003-11-27 Thread Chris Elsworth
On Wed, Nov 26, 2003 at 06:44:57PM -0600, Matt W wrote: > Hi Chris, > > It doesn't take MySQL any more or less time to update a unique index > than a non-unique one. :-) Ah, a nice simple answer to a long drawn out question :) Thanks Matt, just the reassurance I was after, I didn't want inserts t

Unique Index efficiency query

2003-11-26 Thread Chris Elsworth
Hello, Let me just outline the table in question first. I have a rather large (40,000,000 rows) table as follows: Table: MessageIDs Create Table: CREATE TABLE `MessageIDs` ( `mid_msgid` char(96) NOT NULL default '', `mid_fileid` int(10) unsigned NOT NULL default '0', `mid_segment` sm