SLOW 22million rows, 5 hour query?

2004-04-23 Thread lists
I have a table with 22,371,273 rows, current type is MyISAM. I have one query tha took nearly 5 hours to complete. I do not know if this like it should be or not, but I thought I'd ask the list. My gut feeling is the `gropu by` that's slowing it down but nonetheless 5 hours seems excessive. I'

RE: Is it possible to get a timestamp from the server ?

2004-04-23 Thread Yoed anis
Yea do a search on the mysql.com web site for "date functions" (or just click here http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html ) its loaded with many examples and descriptions of useful functions. Built in date calculations are one thing I really enjoy with mysql. Best, Yoed -

Re: Unixware 7.1.0 compile error... mysql 4.0.18

2004-04-23 Thread Steven Palm
Well, using gcc-3.3_branch and UnixWare 7.1.0, I tried the dev release 4.1.1-alpha off the mysql site to see if I would have better luck CC="gcc" CFLAGS="-I/usr/local/include" CXX="gcc" CXXFLAGS="-I/usr/local/include " ./configure --prefix=/usr/local/mysql --with-innodb --with-berkeley

Re: Unixware 7.1.0 compile error... mysql 4.0.18

2004-04-23 Thread Steven Palm
On Apr 23, 2004, at 8:30 AM, Boyd Lynn Gerber wrote: I always download the lastest CVS with all patches for the tree of gcc that I am using. The latest patches to all version of gcc are on the CVS tree or branch for the version. These are often needed to get MySQL to work. Striking out with th

RE: Is it possible to get a timestamp from the server ?

2004-04-23 Thread Brian Mansell
To get the current year, use: SELECT DATE_FORMAT(NOW(), '%Y'); Basically you can use the DATE_FORMAT to show the present time as desired. --bmansell -Original Message- From: Greg Hosler [mailto:[EMAIL PROTECTED] Sent: Friday, April 23, 2004 5:08 PM To: [EMAIL PROTECTED] Subject:

Is it possible to get a timestamp from the server ?

2004-04-23 Thread Greg Hosler
Hi, I have a database application that I am porting to MySQL. one of the things that the application needs to do is to get a timestamp from the server, so that all instances of the application across a network can timestamp cewrtain records using a common source for the timestamp. e.g. the sql ser

Re: mysql using big two tables in BSD

2004-04-23 Thread kamlesh pandey
Hi Ken, I added the index as per your suggestion ,but looks like mysql is not using that index(user_id,user_data2). Here is my actual explain output for real tables. NOTE For alert_type_list :type_id_idx is index on alr_type,id id_type_idx is index on id,alr_type id_idx is index on id id on n

Re: Compound Primary Key question

2004-04-23 Thread Jeremy Zawodny
On Fri, Apr 23, 2004 at 03:40:43PM -0700, Emmett Bishop wrote: > Quick question. In general, is it better to create > compound primary keys or use an auto increment field > to uniquely identify each record? Yes. It depends on your application and your data. Jeremy -- Jeremy D. Zawodny | Pe

Compound Primary Key question

2004-04-23 Thread Emmett Bishop
Quick question. In general, is it better to create compound primary keys or use an auto increment field to uniquely identify each record? --T __ Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25ยข http://photos.yahoo.c

RE: Patches

2004-04-23 Thread Dathan Vance Pattishall
Do you want the binary or the src code? http://dev.mysql.com/downloads/index.html If you want the developer repo go here. http://dev.mysql.com/doc/mysql/en/Installing_source_tree.html > -Original Message- > From: Hassan Shaikh [mailto:[EMAIL PROTECTED] > Sent: Friday, April 23, 2004 12

Patches

2004-04-23 Thread Hassan Shaikh
Where can I download patches for MySQL 4.0.17 from? Thanks. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: oblivious to the obvious

2004-04-23 Thread Arthur Pelkey
thanks for the input, i guess i should stop re-using code that does't apply in all situations, such as update not returning a result, etc, etc while im tired ;), thanks! Ivan Cukic (Foment) wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 | $result = mysql_query("UPDATE sunday SET | a5_n_1=

Re: oblivious to the obvious

2004-04-23 Thread Ivan Cukic (Foment)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 | $result = mysql_query("UPDATE sunday SET | a5_n_1='$sun_5a_n1',a5_t_1='$sun_5a_t1'") What do you expect the UPDATE command to return? I think that you have the error here: | while($row = mysql_fetch_array($result)) { and here | mysql_free_result($

Re: [PHP] oblivious to the obvious

2004-04-23 Thread Matt Matijevich
[snip] $sun_5a_n1 = "1"; $sun_5a_t1 = "2"; if($sun_5a_n1) { $result = mysql_query("UPDATE sunday SET a5_n_1='$sun_5a_n1',a5_t_1='$sun_5a_t1'") while($row = mysql_fetch_array($result)) { (line 17)echo "Sunday @ 5am slot modified to Name: $sun_5a_n1, Time: $sun_5a_t

Re: oblivious to the obvious

2004-04-23 Thread Paul DuBois
At 15:58 -0400 4/23/04, Arthur Pelkey wrote: I keep getting Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in lines 17 and 21, they are marked below. I am drawing a blank, starting to doze off also :S, thunderbird has crappy default composition widths(anyone

oblivious to the obvious

2004-04-23 Thread Arthur Pelkey
I keep getting Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in lines 17 and 21, they are marked below. I am drawing a blank, starting to doze off also :S, thunderbird has crappy default composition widths(anyone know how to change it?), so the formatting

Re: Unixware 7.1.0 compile error... mysql 4.0.18

2004-04-23 Thread Steven Palm
On Apr 23, 2004, at 8:30 AM, Boyd Lynn Gerber wrote: I always download the lastest CVS with all patches for the tree of gcc that I am using. The latest patches to all version of gcc are on the CVS tree or branch for the version. These are often needed to get MySQL to work. Bother... I have all

Re: Executing Pre-Written Commands

2004-04-23 Thread Michael Stassen
Brian Reichert wrote: On Fri, Apr 23, 2004 at 10:47:53AM -0400, Chris Stevenson wrote: Anyone out there have any experience with the book MySQL by Paul DuBois? I'm having trouble figuring out how to save/reuse executed commands (primarily creating tables at this point). Perhaps I could bounce a f

RE: mySQL: Table locking problems when non-index keys used

2004-04-23 Thread Dathan Vance Pattishall
Use indexes. Make sure your indexes are on the right side of the where clause ie. SELECT col1,col2 from tablewithproperindexes where col3=const_index_lookup. Or you can use a dirty read as your transaction model to help out a TINY bit. -- DVP > -Original Message- > From: [EMAIL PROTECT

RE: query mysql data dictionary

2004-04-23 Thread Dathan Vance Pattishall
SHOW KEYS FROM > -Original Message- > From: sbv chris [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 22, 2004 7:26 AM > To: [EMAIL PROTECTED] > Subject: query mysql data dictionary > > Hi, I'm trying to find a way to find the primary keys in a table and find > constraints on a table

RE: update if insert fails

2004-04-23 Thread Dathan Vance Pattishall
You can use replace into, but note it cannot do Replace into table VALUES (1,2,3,col4+1); > -Original Message- > From: Andy Ford [mailto:[EMAIL PROTECTED] > Sent: Friday, April 23, 2004 3:59 AM > To: [EMAIL PROTECTED] > Subject: update if insert fails > > Hi > > Is there such a statem

RE: Executing Pre-Written Commands

2004-04-23 Thread Dathan Vance Pattishall
Paul book is killer, I have the 1st and second addition - but to answer your question the mySQL client can save commands, but if your looking for something in mySQL itself to do that it can't. To create tables you can do something like this. %>mysql -h -uroot -p -f < The ddl file (text file) ca

query mysql data dictionary

2004-04-23 Thread sbv chris
Hi, I'm trying to find a way to find the primary keys in a table and find constraints on a table by sql. I would like to later issue these sql statements through jdbc. hows this done in mysql? Regards, Sunil. _ Lose those love han

RE: InnoDB Load Problem

2004-04-23 Thread Dathan Vance Pattishall
Run Show INNODB status. Look at -- BUFFER POOL AND MEMORY -- Total memory allocated 1299859045; in additional pool allocated 6113152 Buffer pool size 71936 Free buffers 59 Database pages 70898 Modified db pages 57113 Pending reads 1 Pending wr

How to translate BerkeleyDB into MySQL

2004-04-23 Thread Valentine Kouznetsov
Hi, I never use MySQL, but force to learn about it. So far I found that MySQL can use BerkeleyDB as underlying DB. My question is how to translate existing Berkeley DB (which was created by other tools) into MySQL DB. Our application has been used Berkeley DB and now we need to move on to MySQL. Is

Re: first LIMIT then ORDER

2004-04-23 Thread Keith C. Ivey
On 23 Apr 2004 at 7:23, Bill Easton wrote: > The last suggestion is useful when you do care which entries you get, > as you can use one order for limit and another for presentation. For > example, if you'd like the LAST 10 rows, but sorted in FORWARD order, > you can use something like > > (s

Re: Executing Pre-Written Commands

2004-04-23 Thread Brian Reichert
On Fri, Apr 23, 2004 at 10:47:53AM -0400, Chris Stevenson wrote: > Anyone out there have any experience with the book MySQL by Paul DuBois? > I'm having trouble figuring out how to save/resuse executed commands > (primarily creating tables at this point). Perhaps I could bounce a few > questions o

Re: Fulltext search over multiple tables

2004-04-23 Thread gerald_clark
I think you want a UNION, not a JOIN. Availabilty of UNION depends on the version you are running. Remi Mikalsen wrote: Hello. I have a problem I believe must have been solved lots of times before. I am doing a fulltext search on two tables at the same time. The problem is that it takes about 20

Executing Pre-Written Commands

2004-04-23 Thread Chris Stevenson
Anyone out there have any experience with the book MySQL by Paul DuBois? I'm having trouble figuring out how to save/resuse executed commands (primarily creating tables at this point). Perhaps I could bounce a few questions offline if you've got used this book before or think you can assist me reg

RE: mysql as a spatial database backend

2004-04-23 Thread emierzwa
James, I replied to you back in January. I tried it with an 854kb WKT block with out any problems. You had sent me a couple WKT samples offline, each of which had errors in them. After I corrected them they worked for me. If you would like to try once more, send me a file, offline, of your table cr

Re: Unixware 7.1.0 compile error... mysql 4.0.18

2004-04-23 Thread Boyd Lynn Gerber
On Thu, 22 Apr 2004, Steven Palm wrote: > Just noticed that what SCO was packaging in their (formerly available) > "Open Source Tool Kit" for Unixware ( ) was 2.95.3pl1... They said it > was 2.95.3 with the following patches: I always download the lastest CVS with all patches for the tree of g

Re: Restore problem between MySQL on Win32 and MySQL on Linux?

2004-04-23 Thread g . lams
It works like a charme with the -Q option Thank you Gael Victoria Reznichenko <[EMAIL PROTECTED]> wrote on 23/04/2004 11.26.01: > [EMAIL PROTECTED] wrote: > > > > I performed the backup (mysqldump -u username -p db > backup.sql) of a > > database on a Win32 (4.0.15-max-debug) server in orde

Re: mysql as a spatial database backend

2004-04-23 Thread James S reid
Ive posted thsi query twice and got no reply - Im sure somebody must know thw answer!!! whast the field length limitations for insertion of a WKT string into a geometry column? yours, close to giving up james -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To uns

Re: Unixware 7.1.0 compile error... mysql 4.0.18

2004-04-23 Thread Boyd Lynn Gerber
On Thu, 22 Apr 2004, Steven Palm wrote: > I built, tested and installed gcc-2.95.3 on my UnixWare 7.1.0 system. > I used your exact configure line above and it died on the > --with-extra-charset=comples (said unknown charset), so I took that > out. However, still the same error: Sorry that sh

RE: update if insert fails

2004-04-23 Thread Donny Simonton
Actually if you are using 4.1.x INSERT INTO table (a,b,c) VALUES (1,2,3) ON DUPLICATE KEY UPDATE c=3; One of the best new features, because insert is faster than an update, update is faster than a delete, and replace is the slowest command you can run. These are based on my benchmarks about 6 mo

Re: My Unicode Woes - Plz Help!!!

2004-04-23 Thread Stormblade
On Thu, 22 Apr 2004 22:30:32 -0700, Dathan Vance Pattishall wrote: > 4.0.18 does not support Unicode. The JDBC driver tries to set the UNICODE > charset but can't because this mysql version cannot store Unicode data as a If it's not storing the unicode as a charset do you have any idea what it's

RE: update if insert fails

2004-04-23 Thread B. Fongo
Use REPLACE instead. It is similar to the INSERT except that, it will replace any old record that match - with the new one. A replace statement may look like this: REPLACE INTO TestTable (TestId, User) VALUES ("007","Bond"); HTH Babs ||> -Original Message- ||> From: Andy Ford [mailt

Re: first LIMIT then ORDER

2004-04-23 Thread Bill Easton
The last suggestion is useful when you do care which entries you get, as you can use one order for limit and another for presentation. For example, if you'd like the LAST 10 rows, but sorted in FORWARD order, you can use something like (select * from HISTORY order by version desc limit 10) ord

Re: update if insert fails

2004-04-23 Thread Victoria Reznichenko
Andy Ford <[EMAIL PROTECTED]> wrote: > > Is there such a statement where, if the insert fails (due to a duplicate > record) an update will happen > Take a look at REPLACE and INSERT .. ON DUPLICATE KEY UPDATE statements: http://dev.mysql.com/doc/mysql/en/REPLACE.html http://dev.m

Re: update if insert fails

2004-04-23 Thread Richard Davey
Hello Andy, Friday, April 23, 2004, 12:59:28 PM, you wrote: AF> Is there such a statement where, if the insert fails (due to a duplicate AF> record) an update will happen No, but you might want to look at REPLACE INTO to simulate this effect. -- Best regards, Richard Davey http://www.phpcomm

update if insert fails

2004-04-23 Thread Andy Ford
Hi Is there such a statement where, if the insert fails (due to a duplicate record) an update will happen Thanks Andy -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Help restoring mysql access

2004-04-23 Thread Egor Egorov
Thursday, April 22, 2004, 9:21:35 PM, Dave Dennis wrote: DD> Is there a procedure to follow for this exactly, step by step? Yes. DD> Its on a running production server, don't want to lose data. Note: If you run MySQL server with --skip-grant-tables option, MySQL will not use privilege tables.

Re: Restore problem between MySQL on Win32 and MySQL on Linux?

2004-04-23 Thread Victoria Reznichenko
[EMAIL PROTECTED] wrote: > > I performed the backup (mysqldump -u username -p db > backup.sql) of a > database on a Win32 (4.0.15-max-debug) server in order to restore it on > Linux server (4.0.15-9) > When I try to restore it on the linux machine (with mysql -u username -p > db < backup.sql),

Re: Storing App Settiings

2004-04-23 Thread olinux
> Unfortunately there is no standard way, i use a > directory called includes > and within that include_top.php includes global > stuff across pages and a > functions.php for functions and defines.php for > defining constants. > parse_ini_file is ok , i have used a modified > function to allow mult

Restore problem between MySQL on Win32 and MySQL on Linux?

2004-04-23 Thread g . lams
Hi All, I performed the backup (mysqldump -u username -p db > backup.sql) of a database on a Win32 (4.0.15-max-debug) server in order to restore it on Linux server (4.0.15-9) When I try to restore it on the linux machine (with mysql -u username -p db < backup.sql), there is an error saying: ERR