Re: Help with subqueries...

2006-04-27 Thread Alex Arul
On 4/28/06, Daevid Vincent <[EMAIL PROTECTED]> wrote: > > vmware reviewit # mysql --version > mysql Ver 14.12 Distrib 5.0.19, for pc-linux-gnu (i686) using readline > 5.1 > > Given two tables: > > CREATE TABLE `logs` ( > `id` bigint(20) unsigned NOT NULL auto_increment, > `user

Help with subqueries...

2006-04-27 Thread Daevid Vincent
vmware reviewit # mysql --version mysql Ver 14.12 Distrib 5.0.19, for pc-linux-gnu (i686) using readline 5.1 Given two tables: CREATE TABLE `logs` ( `id` bigint(20) unsigned NOT NULL auto_increment, `user_id` int(10) unsigned default '0', `created_on` timestamp NOT

Re: selecting all records inserted last 1 minutes?

2006-04-27 Thread Paul DuBois
At 22:29 -0500 4/27/06, Afan Pasalic wrote: No, not exactly. More as "there is a solution"... What would be the best way to do? -afan What's wrong with WHERE last_access >= NOW() - INTERVAL 1 HOUR ? You don't want CURTIME(), I think, because that has only time, not the date. Paul DuBois w

Re: selecting all records inserted last 1 minutes?

2006-04-27 Thread Afan Pasalic
No, not exactly. More as "there is a solution"... What would be the best way to do? -afan Paul DuBois wrote: At 20:52 +0200 4/27/06, [EMAIL PROTECTED] wrote: Hi, I was trying to list all registeed users they are "online" last 15 minutes. I can do it by using timestamp: = '$start_time' ?>

RE: HELP --- Slow SP

2006-04-27 Thread Quentin Bennett
Hi Hardi, You may need to supply a bit more information - table formats, query string, output from EXPLAIN - to allow more detailed diagnosis. Quentin -Original Message- From: Hardi OK [mailto:[EMAIL PROTECTED] Sent: Friday, 28 April 2006 1:14 p.m. To: Daniel Kasak Cc: Quentin Bennett

Re: HELP --- Slow SP

2006-04-27 Thread Daniel Kasak
Hardi OK wrote: Hi, When I used the EXPLAIN command, i see that all of my query are using the correct index. That's why i was quite sure that index won't be the cause of my slow query problem. So, i now should alter the table: remove primary key and recreate index? If your queries are us

Re: HELP --- Slow SP

2006-04-27 Thread Hardi OK
Hi, When I used the EXPLAIN command, i see that all of my query are using the correct index. That's why i was quite sure that index won't be the cause of my slow query problem. So, i now should alter the table: remove primary key and recreate index? Many thanks, Hardi On 4/28/06, Daniel Kasak

Re: HELP --- Slow SP

2006-04-27 Thread Daniel Kasak
Quentin Bennett wrote: I think that you can use the left most columns of the index, without including the remainder. That's wasn't my understanding of how things work, but I've just checked the documentation, and it looks like you're right: MySQL cannot use a partial index if the colum

RE: HELP --- Slow SP

2006-04-27 Thread Quentin Bennett
[snip] Next point is that MySQL will only make use of an index in a join or a where clause if ONLY that field is included in the index. If you pack 3 fields into an index and then try to join on ONLY ONE field, the index can't be used. So look at your joins and where clauses and make sure your

Re: How to select the last entry per item

2006-04-27 Thread Peter Brawley
Brian Hi, I hope this is the right list for this question. If not, I'm happy to get help on where to post this question.  Apologies in advance if this is an old question. We are designing a simple a tracking database with a table of entries showing the current location of each it

Re: HELP --- Slow SP

2006-04-27 Thread Daniel Kasak
Hardi OK wrote: Hi Forums, I have a frustrating problem on my Stored Procedure. It can only proccess about 100 records in 10 minutes. I have 2 million initial records that need to processed. Meaning that with this speed i will around 200 days to finish all of them. To make it worse, the data its

RE: Out of memory (Needed xxx ...

2006-04-27 Thread Robert DiFalco
Setting max_allowed_packet does not seem to make a difference on how large the blob to the database can be. The MySQL server still gives the OOM exception after streaming ~600mb to a LOB regardless of how max_allowed_packet is set. R. From: Carlos Proal [mailto:

Re: How to select the last entry per item

2006-04-27 Thread Terry Burton
On 4/27/06, Brian J. Matt <[EMAIL PROTECTED]> wrote: > As the items move new time stamped entries are added to the > database. How would you query to find the current location of all > the items currently in the system. As you might expect we don't want > to replace the entry for an item when a l

Problem with bk tree of MySQL 4.1 for two days.

2006-04-27 Thread Boyd Lynn Gerber
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have been unable to use the bk client to update my bk trees. I just hangs /usr/local/bin/bk-update bk://mysql.bkbits.net/mysql-4.1 mysql-4.1 I usually run this every 4 hours to keep my local trees up to date. The process usually completes in a f

Re: Can I select from remote tables in mysql 5.0.18-standard-log?

2006-04-27 Thread Kishore Jalleda
On 4/27/06, P. Evans <[EMAIL PROTECTED]> wrote: > > Hello Listers, > Is it possible to run a query on one mysql server to another database on > a different server ? > eg creating an alias in database A on server A to table B on database B on > server B ? > > Like a federated nickname on db2 udb or

Re: selecting all records inserted last 1 minutes?

2006-04-27 Thread Paul DuBois
At 20:52 +0200 4/27/06, [EMAIL PROTECTED] wrote: Hi, I was trying to list all registeed users they are "online" last 15 minutes. I can do it by using timestamp: = '$start_time' ?> But, I know there is something like: SELECT * FROM members WHERE last_access BETWEEN(CURTIME(), INTERVAL 15 MIN) ?

Re: Can I select from remote tables in mysql 5.0.18-standard-log?

2006-04-27 Thread Paul DuBois
At 14:38 -0700 4/27/06, P. Evans wrote: Hello Listers, Is it possible to run a query on one mysql server to another database on a different server ? eg creating an alias in database A on server A to table B on database B on server B ? Like a federated nickname on db2 udb or synonym on

Can I select from remote tables in mysql 5.0.18-standard-log?

2006-04-27 Thread P. Evans
Hello Listers, Is it possible to run a query on one mysql server to another database on a different server ? eg creating an alias in database A on server A to table B on database B on server B ? Like a federated nickname on db2 udb or synonym on informix ? Thanks Pierre

selecting all records inserted last 1 minutes?

2006-04-27 Thread afan
Hi, I was trying to list all registeed users they are "online" last 15 minutes. I can do it by using timestamp: = '$start_time' ?> But, I know there is something like: SELECT * FROM members WHERE last_access BETWEEN(CURTIME(), INTERVAL 15 MIN) ?!? Thanks for any help. -afan -- MySQL General

Re: Out of memory (Needed xxx ...

2006-04-27 Thread Carlos Proal
As far as i remember you must set that variable in order to send huge blobs, and the error message can vary because it can means that the current memory space for that connection has been filled. Why not do you try to set it up, as mentioned in the manual and check the results. Im forwarding this

RE: Import from unknown format (.bdd .ind .mor .ped)

2006-04-27 Thread George Law
Pedro, I haven't ever seen those file types - but just a thought. Maybe they are Just flat files and the extension relates to the "table" contained there in. If you have unix shell access, try the "file" command - ie "file file.bdd" If it reports plain text - chances are its just a flat file -

Import from unknown format (.bdd .ind .mor .ped)

2006-04-27 Thread Pedro mpa
Greetings. I need to import data to mysql from a db format I don't know. Unfortunately the person in charge of the data won't be reachable for the next 2 weeks and I want to continue my work. Does anyone knows the db format extensions like: .bdd .ind .mor .ped Thanks in advance. Apologies for m

RE: How to select the last entry per item

2006-04-27 Thread Tim Lucia
Invert the problem ;-) Sort descending by the time_stamp field and limit the result to 1, i.e. SELECT * FROM table_xyz ORDER BY time_stamp DESC LIMIT 1 Tim -Original Message- From: Brian J. Matt [mailto:[EMAIL PROTECTED] Sent: Thursday, April 27, 2006 1:37 PM To: mysql@lists.mysql.co

How to select the last entry per item

2006-04-27 Thread Brian J. Matt
Hi, I hope this is the right list for this question. If not, I'm happy to get help on where to post this question. Apologies in advance if this is an old question. We are designing a simple a tracking database with a table of entries showing the current location of each item in the system.

Re: Multiple primary keys

2006-04-27 Thread Gordon
MySQL will not use the primary key unless you use the left most columns. For a 1 column primary key then it's easy. For a 2 column primary key you can either use the 1st column in the primary key or both columns. If you only reference the 2nd column the query will not use the primary key and wil

RE: Multiple primary keys

2006-04-27 Thread nngau
Thanks all. The query I run is a subquery. I noticed joined query run a lot faster than the sub. This is the subquery: select * from class_c where detail_id in (select classC from item_classification where classb="216") order by detail; This query takes nearly 3 minutes, before it did not take

Re: Multiple primary keys

2006-04-27 Thread Kishore Jalleda
On 4/27/06, nngau <[EMAIL PROTECTED]> wrote: > > Can someone figure out what's going on. This is the only change > I made to this table. Basically I don't want any duplicate rows, so > I setup 4 fields to be my primary key. > > When I do a simple select query it takes nearly 30 seconds to complete.

Re: Multiple primary keys

2006-04-27 Thread chriswhite
Quoting nngau <[EMAIL PROTECTED]>: Can someone figure out what's going on. This is the only change I made to this table. Basically I don't want any duplicate rows, so I setup 4 fields to be my primary key. If you don't want any duplicate rows, use UNIQUE, all those primary keys will just take

Multiple primary keys

2006-04-27 Thread nngau
Can someone figure out what's going on. This is the only change I made to this table. Basically I don't want any duplicate rows, so I setup 4 fields to be my primary key. When I do a simple select query it takes nearly 30 seconds to complete. This is affecting my websites and taking a very long t

Re: Update not working in a script, but going fine running with MySQL Browser

2006-04-27 Thread mysql
Hi Luis. It sounds like your script may not be initialising those two variables correctly. Are the variables being set properly in your script before sending the insert query to mysql? MySQL will quite happily insert an empty string value, '' into a char field without generating an error mess

Update not working in a script, but going fine running with MySQL Browser

2006-04-27 Thread luis perez
Hi guys. Got a problem when adding records to an existing table, as part of a sql script. There are a couple of fields that don't get added as they should (respaccstopframe and acstpradiusid). This is the update command: insert into temp_s1 (accsesid, respaccstopframe, acstpradiusid, sgsnip,

Re: need help for my jointure

2006-04-27 Thread Patrick Aljord
On 4/26/06, Shawn Green <[EMAIL PROTECTED]> wrote: > > > > --- Patrick Aljord <[EMAIL PROTECTED]> wrote: > > > On 4/26/06, Patrick Aljord <[EMAIL PROTECTED]> wrote: > > > I have a table confs like this: > > > id int 5 auto_increment primary key; > > > conf text; > > > > > > and another table conf_i

HELP --- Slow SP

2006-04-27 Thread Hardi OK
Hi Forums, I have a frustrating problem on my Stored Procedure. It can only proccess about 100 records in 10 minutes. I have 2 million initial records that need to processed. Meaning that with this speed i will around 200 days to finish all of them. To make it worse, the data itself grows at least

Re: mysqldump and foreign keys

2006-04-27 Thread Frank
Nico Rittner wrote: > Hi Frank > >> what I meant was: are you sure that the tables which are in your database >> are defined correctly, i.e. have the actions? > Yes, if i try to delete or update a record which is referenced by another > i get mysql error #1217 , which should be correct. > >> mig