Re: MySQL daemons restarting every 7 minutes

2011-09-08 Thread Suresh Kuna
Can yo paste the complete error log, Ram memory size and configuration file here and make sure the machine has enough memory to run the services. Check the sys log for what is happening just before the service restart. On Wed, Sep 7, 2011 at 10:51 PM, wrote: > Hi, > > as of yesterday the MySQL

Re: strange mysql update ..

2011-09-08 Thread Suresh Kuna
Nice Rik! On Thu, Sep 8, 2011 at 3:19 PM, Rik Wasmus wrote: > > I fired the update statement in a wrong way ..like this .. > > > > update user_info set login_date='2011-08-05 04:15:05' and user_id > =16078845 > > limit 1 ; > > ( I forgot to use where . instead of where I used and ) > > update us

Re: trying to change wait_timeout

2011-09-08 Thread Suresh Kuna
Set the variable wait_timeout=xxx value under the mysqld section of the configuration file and restart the mysqld server. Now check show global variables like 'wait_timeout"; It should be you xxx value what ever you set. On Thu, Sep 8, 2011 at 7:25 PM, Andrew Moore wrote: > Check that you're l

Re: Is it it posiible to combine the C++ algorithm code, the MYSQL source code and the UDF code into a single DLL/SO?

2011-09-08 Thread Frank Chang
Good evening, Apparently MySQL supports a single client connection to a local MySQL server Quoting from the MySQL :: MySQL 5.0 Reference Manual :: 4.2.2 Connecting to the MySQL Server URL by Booz-Allen New York City consultants The following table shows the permissible --protocol optio

Re: Query Optimization

2011-09-08 Thread Brandon Phelps
Ah I see. Well thanks for your assistance! -Brandon On 09/08/2011 05:21 PM, Mihail Manolov wrote: From the manual: "The default behavior for UNION is that duplicate rows are removed from the result." On Sep 8, 2011, at 4:50 PM, Brandon Phelps wrote: Mihail, Thanks so much! I modified yo

Re: Query Optimization

2011-09-08 Thread Mihail Manolov
>From the manual: "The default behavior for UNION is that duplicate rows are >removed from the result." On Sep 8, 2011, at 4:50 PM, Brandon Phelps wrote: > Mihail, > > Thanks so much! I modified your example to include the proper ORDER BY and > LIMIT clauses and this, so far, is running super

Re: Query Optimization

2011-09-08 Thread Brandon Phelps
Mihail, Thanks so much! I modified your example to include the proper ORDER BY and LIMIT clauses and this, so far, is running super fast (0.0007 seconds). Question, if a record's open_dt is between the range AND the close_dt is between the range as well, will the UNION output the record twic

Re: Query Optimization

2011-09-08 Thread Brandon Phelps
Andrew, Generally there is only 1 user performing the complicated SELECT query at a time, however the background process that fills the table is constantly doing a fast SELECT (0.3 seconds) and a subsequent UPDATE. Basically whenever a connection is closed on the firewall, the bg process

Re: Query Optimization

2011-09-08 Thread Mihail Manolov
How about: SELECT sc.open_dt, sc.close_dt, sc.protocol, INET_NTOA(sc.src_address) AS src_address, sc.src_port, INET_NTOA(sc.dst_address) AS dst_address, sc.dst_port, sc.sent, sc.rcvd, spm.desc AS src_port_desc,

Is it it posiible to combine the C++ algorithm code, the MYSQL source code and the UDF code into a single DLL/SO?

2011-09-08 Thread Frank Chang
Good afternoon, We developed a C++ class algorithm and code together with sqlite3.c and the sqlite C/C++ UDFs. Everything is combined into a single Windows DLL/UNIX-LINUX SO Now we would like to change from SQLite to MySQL to take advantage of MySQL's ability to do parallel writes on separate thre

Re: Query Optimization

2011-09-08 Thread Andrew Moore
Partitioning isn't a bad idea for this however I'm still thinking about your dataset size and possible hardware limitations. It's not likely going to fit into relevant buffers/memory so you're going to be on disk more then you want. You're probably creating temporary tables like crazy and I would b

Re: Query Optimization

2011-09-08 Thread Brandon Phelps
Thanks for the idea Derek, however given the following query my EXPLAIN output is identical: SELECT sc.open_dt, sc.close_dt, sc.protocol, INET_NTOA(sc.src_address) AS src_address, sc.src_port, INET_NTOA(sc.dst_address) AS dst_address, sc.ds

Re: Query Optimization

2011-09-08 Thread Brandon Phelps
Mihail, I have considered this but have not yet determined how best to go about partitioning the table. I don't think partitioning by dst_address or src_address would help because most of the queries do not filter on IP address (except very specific queries where the end-user is searching the

Re: Query Optimization

2011-09-08 Thread Derek Downey
Correct me if I'm wrong. You're wanting to get all records that have an open_date or a close_date between two times. If that's correct, you might be able to get an index_merge by doing a query like: WHERE ((starting time)<=open_dt<= (ending time)) OR ((starting time)<=close_dt<=(ending time))

Re: Query Optimization

2011-09-08 Thread Brandon Phelps
Andy, The queries take minutes to run. MySQL is 5.1.54 and it's running on Ubuntu server 11.04. Unfortunately the machine only has 2GB of RAM but no other major daemons are running on the machine. We are running RAID 1 (mirroring) with 1TB drives. The tables in question here are all MyISAM

Re: Query Optimization

2011-09-08 Thread Mihail Manolov
If you're running version 5.1+ you may wanna take a look at table partitioning options you may have. On Sep 8, 2011, at 2:27 PM, Brandon Phelps wrote: > Thanks for the reply Andy. Unfortunately the users will be selecting varying > date ranges and new data is constantly coming in, so I am not

Re: Query Optimization

2011-09-08 Thread Andrew Moore
I don't think I saw any query timings in the emails (maybe I missed them). What version of MySQL are you currently using? What does the explain look like when your remove the limit 10? Is your server tuned for MyISAM or InnoDB? What kind of disk setup is in use? How much memory is in your machine?

Re: Query Optimization

2011-09-08 Thread Brandon Phelps
Thanks for the reply Andy. Unfortunately the users will be selecting varying date ranges and new data is constantly coming in, so I am not sure how I could archive/cache the necessary data that would be any more efficient than simply using the database directly. On 09/08/2011 02:16 PM, Andre

Re: Query Optimization

2011-09-08 Thread Andrew Moore
Thinking outside the query, is there any archiving that could happen to make your large tables kinder in the range scan? Andy On Thu, Sep 8, 2011 at 7:03 PM, Brandon Phelps wrote: > On 09/01/2011 01:32 PM, Brandon Phelps wrote: > >> On 09/01/2011 12:47 PM, Shawn Green (MySQL) wrote: >> >>> On 9

Re: Query Optimization

2011-09-08 Thread Brandon Phelps
On 09/01/2011 01:32 PM, Brandon Phelps wrote: On 09/01/2011 12:47 PM, Shawn Green (MySQL) wrote: On 9/1/2011 09:42, Brandon Phelps wrote: On 09/01/2011 04:59 AM, Jochem van Dieten wrote: > > ... > > WHERE > > (open_dt >= '2011-08-30 00:00:00' OR close_dt >= '2011-08-30 00:00:00') > > AND (open

Triggers - Accessing all NEW data

2011-09-08 Thread Chris Tate-Davies
Hello. I want to know if there is a special way I can access all the data in the NEW/OLD data? I realise I can access it by referencing NEW.fieldname but I want to serialise the NEW object so I can save as a string. Is this possible or do I need to write a function? Thanks, Chris *Chris T

Re: trying to change wait_timeout

2011-09-08 Thread Andrew Moore
Check that you're looking at the variable in the GLOBAL scope not the SESSION scope. SHOW GLOBAL VARIABLE ... Andy On Thu, Sep 8, 2011 at 11:34 AM, Bruce Ferrell wrote: > On 09/08/2011 02:56 AM, Johan De Meersman wrote: > >> - Original Message - >> >>> From: "Bruce Ferrell" >>> To: mysq

Re: trying to change wait_timeout

2011-09-08 Thread Bruce Ferrell
On 09/08/2011 02:56 AM, Johan De Meersman wrote: - Original Message - From: "Bruce Ferrell" To: mysql@lists.mysql.com Sent: Thursday, 8 September, 2011 3:10:16 AM Subject: trying to change wait_timeout I've read the documentation on MySQL for version 5.1 and it says all I have to do is

Re: trying to change wait_timeout

2011-09-08 Thread Johan De Meersman
- Original Message - > From: "Bruce Ferrell" > To: mysql@lists.mysql.com > Sent: Thursday, 8 September, 2011 3:10:16 AM > Subject: trying to change wait_timeout > > I've read the documentation on MySQL for version 5.1 and it says all > I have to do is to place the following: > wait_timeou

Re: strange mysql update ..

2011-09-08 Thread Rik Wasmus
> I fired the update statement in a wrong way ..like this .. > > update user_info set login_date='2011-08-05 04:15:05' and user_id =16078845 > limit 1 ; > ( I forgot to use where . instead of where I used and ) > update user_info set login_date='2011-08-05 04:15:05' where user_id > =16078845 limit

Re: strange mysql update ..

2011-09-08 Thread umapathi b
Here is the o/p after the update .. user_id: 16078845 drivers_license: TEST1140DL login_date: 2011-06-19 11:20:07 course_id: 1011 regulator_id: 10840 test_info: completion_date: 2011-06-19 11:37:16 print_date: NULL passwor

Re: strange mysql update ..

2011-09-08 Thread Ananda Kumar
Can you lets us know what is the output of select * from user_info where user_id=16078845; On Thu, Sep 8, 2011 at 1:02 PM, umapathi b wrote: > I wanted to change the login_date of one user . The original data of that > user is like this .. > > select * from user_info where user_id = 16078845 \G

strange mysql update ..

2011-09-08 Thread umapathi b
I wanted to change the login_date of one user . The original data of that user is like this .. select * from user_info where user_id = 16078845 \G *** 1. row *** user_id: 16078845 drivers_license: TEST1140DL login_date: 2011-06-