RE: Reg SubQuery

2004-12-01 Thread Amit_Wadhwa
Or.. Select * from emp order by id asc limit 0,1 if you want to  fetch
all details.

-Original Message-
From: Jason McKnight [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 01, 2004 7:21 PM
To: [EMAIL PROTECTED]
Subject: Re: Reg SubQuery

You could also do it like this:

select min(id) from emp;


Roger Baklund wrote:

 [EMAIL PROTECTED] wrote:

 I need to get all the details of an employee whose salary is the
lowest.
 I can do like this in Oracle


 select * from emp where id = (select min(id) from emp).


 Can we have any alternative in MySQL for the above query, as sub 
 queries are not supported in MySQL 4.0.21


 There is no need for a subquery in this case:

 select * from emp order by id limit 1;



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Changing Date Type

2004-11-05 Thread Amit_Wadhwa
I know that defining a Data datatype in a table renders the date in the
form that the database is set to,
Ie. -mm-dd by default.

I want this to remain, but for one particular table, I want to set it to
d-mmm-yy Eg. 5-nov-04 or 15-nov-04 instead of 2004-11-05 like the rest
of my tables.
I do not want to change my other tables or their settings, is this
possible?

Pls. assist.
Regards,
Amit Wadhwa.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Changing Date Type

2004-11-05 Thread Amit_Wadhwa
Yes, but I want to be able to insert into the column dates in the format
d-mmm-yy

-Original Message-
From: Martijn Tonies [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 05, 2004 8:38 PM
To: Wadhwa, Amit; [EMAIL PROTECTED]
Subject: Re: Changing Date Type



 I know that defining a Data datatype in a table renders the date in 
 the form that the database is set to, Ie. -mm-dd by default.

 I want this to remain, but for one particular table, I want to set it 
 to d-mmm-yy Eg. 5-nov-04 or 15-nov-04 instead of 2004-11-05 like the 
 rest of my tables.
 I do not want to change my other tables or their settings, is this 
 possible?

Isn't that just a _display_ format?

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL  MS
SQL Server.
Upscene Productions
http://www.upscene.com



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Changing Date Type

2004-11-05 Thread Amit_Wadhwa
Because im reading data from another source which is always going to be
in this format, and then inserting into the database.
Thought if there was a way I could escape having to change the format
before I insert into mysql...
Sorry abt the high importance, it was turned on by default in my editor.

-Original Message-
From: Martijn Tonies [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 05, 2004 9:44 PM
To: Wadhwa, Amit; [EMAIL PROTECTED]
Subject: Re: Changing Date Type



 Yes, but I want to be able to insert into the column dates in the 
 format d-mmm-yy

That's a different story.

Question though: why?

Read some docs:
http://dev.mysql.com/doc/mysql/en/Date_and_time_types.html

btw, why is your e-mail important or high priority to me or the
list?

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL  MS
SQL Server.
Upscene Productions
http://www.upscene.com


  I know that defining a Data datatype in a table renders the date in 
  the form that the database is set to, Ie. -mm-dd by default.
 
  I want this to remain, but for one particular table, I want to set 
  it to d-mmm-yy Eg. 5-nov-04 or 15-nov-04 instead of 2004-11-05 like 
  the rest of my tables.
  I do not want to change my other tables or their settings, is this 
  possible?

 Isn't that just a _display_ format?

 With regards,

 Martijn Tonies
 Database Workbench - developer tool for InterBase, Firebird, MySQL  
 MS SQL Server.
 Upscene Productions
 http://www.upscene.com





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Java.lang.outOfMemoryError on large ResultSet

2004-10-20 Thread Amit_Wadhwa
MySQL 5.0 Alpha
Jdbc Driver: Connector J
OS: Windows 2000 Professional

Table Size 1 Mil. Records.

Table Structure:
Table1
logid - autoincrement int(11)
Timestamp - timestamp
Timestamp2 - timestamp
Tag - varchar(15)


Query/Code:
---
PreparedStatement pst = con.prepareStatement(Select
logid,timestamp,Timestamp2,Tag from Table1);
Resultset rs   = pst.executeQuery(); //getting
java.lang.outOfMemoryError here, even before retrieving the resultset
below.
While (rs.next())
{
//check something, do something..
}

... Tried the same thing above doing it 3 times, with limits of 400k at
a time. The first loop goes through fine.
2nd loop which has a limit of 360k-760k again gives out of memory
exception.


What shall I do?
I have to iterate through all the Mil. Records..
(This is a once-a-week operation).

I have increased Max_Allowed_Packet to 200M , and it still gives the
same errors, so I know that's not the problem here.

Please advice.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Long Running Queries

2004-10-06 Thread Amit_Wadhwa
You need Appropriate Indexes on the tables. 

-Original Message-
From: Jason Williard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 07, 2004 1:11 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Long Running Queries

Hello,

I recently began experiencing issues that I would like some assistance
with.

Server Details:
  - Windows 2003
  - MySQL Max 4.0.20a

I have a table with 450,000+ records in it.  When I try to run a single
query, such as selecting 1 row or deleting 1 row using the WHERE clause,
the query can take forever to run.  In a specific case, it took 57
seconds to complete the SELECT query.

Any ideas on how to speed this up?
-- 

Thank You,
Jason Williard



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Long Running Queries

2004-10-06 Thread Amit_Wadhwa
appropriate indexes would mean indexes on columns specified in your
where criteria.
On this List, people mostly post table structures, as well as the
queries they are firing, or else it really doesn't help. 

-Original Message-
From: Danny Willis [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 07, 2004 1:24 AM
To: Wadhwa, Amit; [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: Long Running Queries

What do you mean by appropriate indexes?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 06, 2004 3:43 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Long Running Queries

You need Appropriate Indexes on the tables. 

-Original Message-
From: Jason Williard [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 07, 2004 1:11 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Long Running Queries

Hello,

I recently began experiencing issues that I would like some assistance
with.

Server Details:
  - Windows 2003
  - MySQL Max 4.0.20a

I have a table with 450,000+ records in it.  When I try to run a single
query, such as selecting 1 row or deleting 1 row using the WHERE clause,
the query can take forever to run.  In a specific case, it took 57
seconds to complete the SELECT query.

Any ideas on how to speed this up?
-- 

Thank You,
Jason Williard



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32 To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: show processlist state value 'statistics'

2004-10-06 Thread Amit_Wadhwa
I have seen a similar option in PHPMyAdmin which says 'Enable
Statistics' 
I suppose when the status shows statistics, mysql is just updating the
statistics in there for the query just run? 

-Original Message-
From: Ananth Reddy [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 06, 2004 11:13 PM
To: [EMAIL PROTECTED]
Subject: show processlist state value 'statistics'

Does anyone know what is the meaning of value 'statistics' in state
column of show processlist?
It is displaying this state during a SELECT query.
I noticed lot of them in DB while our application is being run in a
stress mode.
This is not documented in Mysql documentation for show processlist

TIA

ananth



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Speeding up index creation

2004-10-06 Thread Amit_Wadhwa
Use Alter table Disable Keys, before loading the Data to your system,
and then Alter table enable keys,
This way you wont have to recreate your indexes
 

-Original Message-
From: Ananth Reddy [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 06, 2004 10:08 PM
To: [EMAIL PROTECTED]
Subject: Speeding up index creation

We have MyISAM table with 150 million rows. The data is being laoded
from other system.
When I load data without indices, it is fast (30 minutes) but creating
index is taking 15 hours.
Load data with indices is taking 30 hours (worse than the other option)

I am wondering if there is a way to speed up the creation of index on a
MyISAM table.
I am specially looking for any memory parameters in config file or any
tweaking at linux level.


Appreciate any help

TIA

ananth


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Long Running Queries

2004-10-06 Thread Amit_Wadhwa
Do this and tell me if it helped

ALTER TABLE `asticketsdata` ADD INDEX ( `ticketidchar` ) 

Regards,
Amit

-Original Message-
From: Jason Williard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 07, 2004 1:42 AM
To: Wadhwa, Amit
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Long Running Queries

Thank you for your assistance with this.  Here's what you were asking
for.

Structure Output:
#
# Table structure for table 'asticketsdata'
#

CREATE TABLE asticketsdata (
   ticketdataid int(11) NOT NULL auto_increment,
   ticketidchar varchar(255) NOT NULL default '',
   ticketidno int(11) default NULL,
   contents text,
   emailbody text,
   PRIMARY KEY  (ticketdataid),
   KEY ticketdata1 (ticketidno)
) TYPE=MyISAM;

Query:
SELECT * FROM asticketsdata WHERE ticketidchar = 'IAZ-16393';

Thank You,
Jason Williard
Client Services



[EMAIL PROTECTED] wrote:
 I have tables with millions of records.
 
 1. I use Query-Caching and that speeds up all my selects/searches 
 after the first time, no matter how complicated the criteria.
 2. Build Indexes on the columns that are in your 'where' Criteria, 
 that will help you big time.
 
 If you post the table structure, and the query, I can help you with 
 your index.
 
 -Original Message-
 From: Jason Williard [mailto:[EMAIL PROTECTED]
 Sent: Thursday, October 07, 2004 1:23 AM
 To: Wadhwa, Amit
 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: Long Running Queries
 
 I'm sorry to sound like a novice, but could you explain that?  Are you

 recommending that I set the column I am searching to an Index?
 
 Thank You,
 Jason Williard
 Client Services
 
 
 
 [EMAIL PROTECTED] wrote:
 
You need Appropriate Indexes on the tables. 

-Original Message-
From: Jason Williard [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 07, 2004 1:11 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Long Running Queries

Hello,

I recently began experiencing issues that I would like some assistance
 
 
with.

Server Details:
  - Windows 2003
  - MySQL Max 4.0.20a

I have a table with 450,000+ records in it.  When I try to run a 
single query, such as selecting 1 row or deleting 1 row using the 
WHERE clause, the query can take forever to run.  In a specific case, 
it took 57 seconds to complete the SELECT query.

Any ideas on how to speed this up?
 
 
 
 
 



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: how to add time to NOW() function

2004-08-06 Thread Amit_Wadhwa
Use 
DATE_ADD(NOW(),INTERVAL 1 HOUR) 
Or 
DATE_ADD(NOW(),INTERVAL 60 MINUTE) 
Or
DATE_ADD(NOW(),INTERVAL 3600 SECOND) 

-Original Message-
From: Deepak Dhake [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 07, 2004 1:58 AM
To: [EMAIL PROTECTED]
Subject: how to add time to NOW() function

i want to add time to NOW() function, that means something like this,

$addTime = 60;
NOW() + $addTime;

where 60 are seconds. I am not sure whether to add seconds or is there
any other format I can use to add time to NOW() function? please let me
know.

thanks in advance.
deepak

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Insert problems with InnoDB (big table)

2004-08-04 Thread Amit_Wadhwa
Are you disabling autocommit before doing the inserts? And committing
after all inserts are complete? 

-Original Message-
From: Luc Charland [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 03, 2004 7:54 PM
To: [EMAIL PROTECTED]
Subject: Insert problems with InnoDB (big table)

We are evaluating the replacement of a Sybase database with MySQL. The
databases are 60+GB, containing more than 100 tables.

Since we need transactions, that implies InnoDB. We were happy with the
early results, but we hit a major roadblock when trying to import the
biggest table (20+GB, with 4 indexes).

We have reproduced the problem with a simpler table on many different
servers and MySQL versions (4.X).

At first, we easily insert 1600+ lines per second. As the number of
lines grows, the performance deteriorate (which I can understand), but
it eventually gets so slow that the import would take weeks.

Doing a vmstat on the server shows that after a certain limit is reached
(index bigger than the total mem ?), mysqld starts reading as much as
writing, and the CPU usage goes down as the I/O eventually reach the
maximum for the server.

If you wait long enough, you get less than 50 lines per second (which is

30+ times slower than the first few million inserts).

We have done the same tests on Sybase and another database on the same
machines and have not seen this behavior, so it is not hardware related.

We have done the same import in a MyISAM table and have not see any
slowdown (the whole data was imported very fast, even if we had to wait
a very long time --5+ hours-- for the index to rebuild after).

We have tried to transform the MyISAM table into a InnoDB (same problem
occurs). We have tried to import from the MyISAM table into an empty
InnoDB, same problem occurs.

SETUP:
We have of course changed the following
innodb_buffer_pool_size= (50% to 80% of total ram)
innodb_log_file_size=(20% to 40% of total ram) we have tried different
innodb_flush_method we have tried innodb_flush_log_at_trx_commit (0, 1)
we have tried ibdata1:1G:autoextend, and also make it big enough so that
all the data will fit without autoextending.
we have tried creating the indexes after instead of before the inserts,
but like the documentation says, it is not better.

Is there an upper limit to the size of the indexes of a single table in
InnoDB?

Anybody else has seen this kind of slowdown for big InnoDB tables?

Here is a small table that reproduce the problem (if you make 5 to 15
million inserts). We wrote a few programs (one in C++, one in Python)
that generates random data and insert into the database.
__

create table smallest ( id int primary key, name varchar(80), model
char(20)
, description varchar(255), lastupdate date, price decimal(8,2), cost
decimal(8,2))
 type=innodb

create unique index smallcomplex on smalltest (model, id, name)
create index smallprice on smalltest (price)
create index smallcost on smalltest (cost)
create index smallname on smalltest (name)
__

Thanks for any help.

Luc Charland


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: slow query when searching database of over 2 million records

2004-06-28 Thread Amit_Wadhwa
Use MySQL Query Caching 

-Original Message-
From: Aasef Iqbal [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 28, 2004 4:46 PM
To: [EMAIL PROTECTED]
Subject: slow query when searching database of over 2 million records

Hi,

I am working on a web project project where one of my pages has to show
a count of total number of matches found and short text for few of them,
just like a search engine. 

I need to issue two queries first one fetches a count  for total matches
found and second query finds detail to 10/20 of those results as
specified by the user. the quries are

select count(distinct CURL) as rc from tbl_directory where MATCH
(CName,DSCR) AGAINST (software project management ) and LinkType = 1
(Time Taken for Total Count :: 207.27026605606)

select distinct CURL,CName,DSCR, MATCH (CName,DSCR) AGAINST (software
project management ) as rel from tbl_directory where MATCH (CName,DSCR)
AGAINST (software project management ) and LinkType = 1 limit 0, 10
(0.26 seconds)

first query always takes much longer time whenever I search for
something new, n in subsequent searches the result is quite satisfactory
(as it comes from query
cache)

is there anyway to speed up the search, im querying some 2 million
records.

thanx in adavnce

Asif Iqbal 




Cool Things Happen When Mac Users Meet! Join the community in Boston
this July: www.macworldexpo.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Speeding up Inserts

2004-05-25 Thread Amit_Wadhwa
Hi All,
Whats the fastest way to speed up inserts?
I have a table which I insert into once a week (about 20-30k Rows)
And select from all the time... 

Is the only way to speed up inserts to remove indexes?
And to speed up selectes, ...add the indexes again?

Regards,
Amit

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Speeding up Inserts

2004-05-25 Thread Amit_Wadhwa
That fixed it, Thanks! 

-Original Message-
From: Mirza [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 25, 2004 7:46 PM
To: [EMAIL PROTECTED]
Subject: Re: Speeding up Inserts

Use:

ALTER TABLE DISABLE KEYS
... inserts here
ALTER TABLE ENABLE KEYS

mirza

[EMAIL PROTECTED] wrote:
 Hi All,
 Whats the fastest way to speed up inserts?
 I have a table which I insert into once a week (about 20-30k Rows) And

 select from all the time...
 
 Is the only way to speed up inserts to remove indexes?
 And to speed up selectes, ...add the indexes again?
 
 Regards,
 Amit
 



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Query question

2004-05-25 Thread Amit_Wadhwa
 Select count(distinct(field)) from table where field = 0 ?

-Original Message-
From: Laercio Xisto Braga Cavalcanti
[mailto:[EMAIL PROTECTED] 
Sent: Monday, May 24, 2004 11:18 PM
To: 'John Nichel'; 'MySQL List'
Subject: RE: Query question

You can do:

Select count(distinct(field)) from table where field  0

Laercio.

-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]
Sent: segunda-feira, 24 de maio de 2004 14:37
To: MySQL List
Subject: Query question

Hi,

   I have a table which I want to select data from (obiviously).  In
this table, I have a field which is an integer, and defaults to 0.  What
I would like to do is count all rows in that table which not only equals
0 for the field, but has a distinct value which is greater than 0.

id  field
1   0
2   0
3   7
4   8
5   7
6   0
7   6
8   7
9   8

For the above example, my count should return 6.  Three zero's count as
3, three seven's count as 1, two eight's count as 1, and one six counts
as 1.

I've tried...

SELECT COUNT(*) FROM db.table WHERE ( field = 0 || ( field  0 
DISTINCT field ) )

But it still returns the count of all the rows.

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Speeding up Inserts

2004-05-25 Thread Amit_Wadhwa
I should have mentioned,
I get data in a text file, Pipe Seperated, Double Quotes Qualifiers,
Eg. 
col1|col2|col3


I tried Load Datafile,
Didn't work for me,
It skips an additional left most character from Col1,
So I get 'ol1' instead of 'col1'

..so as of now, I am importing into Access,
Then using JDBC to select from Access,
And then insert into Mysql.

If you could tell me what the exact syntax is for Load Data Infile, with
any possible things to keep in mind, would be awesome,
Thanks in advance
Regards,
Amit



-Original Message-
From: mos [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 25, 2004 7:57 PM
To: [EMAIL PROTECTED]
Subject: Re: Speeding up Inserts

At 08:55 AM 5/25/2004, you wrote:
Hi All,
Whats the fastest way to speed up inserts?
I have a table which I insert into once a week (about 20-30k Rows) And 
select from all the time...

Is the only way to speed up inserts to remove indexes?
And to speed up selectes, ...add the indexes again?

Regards,
Amit
Amit,
 Use Load Data Infile if the data is coming from a text file. To
load 30k rows should take a few seconds.

Mike 


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Datetime format in MySQL

2004-04-22 Thread Amit_Wadhwa
Hi All,
Can you  specify what format to use for the datetime column eg.
in oracle you can say I wanna use DD-MMM- HH:MM:SS and so on?

Regards,
Amit


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Slow Query Question - Need help of Gurus.

2004-04-17 Thread Amit_Wadhwa
Hi All,
I have a huge Database which contains about 500,000 records, (will be
adding about 20-25k records every week)
I need to run group queries and output the same to a web interface. 

An example is: 

SELECT DISTINCT(`Call Svc Tag ID`),Count(`Call Svc Tag ID`) as counter,
`Journal Create Date`  FROM 31909_859552 WHERE `Journal Create Date`
between '2004-03-13' AND  '2004-03-16'  and `Call Svc Tag ID`'null'
GROUP BY `Call Svc Tag ID` having count(`Call Svc Tag ID`)3 order by
counter;

--basically finding out repeat journal entries over a period of 3 days
for the same tag..
(the no. of days may vary.. 2/3/4/5... , and same goes with the having
count clause..)
The output results to about 150-1 rows or so.. Based on selections

-I've designed the table to be a MyISAM (I don't care how long inserts
take, that will be a once-a-week-one-time process on the server, I want
the selects to be fast)
- At present a select takes anywhere from 20 seconds to 10 minutes on
such queries.

What can I do?

Till now we were using MS Access, and no web based interface.
Running a normal MySQL 4.0 install on windows 2000, 256 MB RAM, 2.6 GHz
P4 NON-HT
About 10 users at a time would be connecting initially.

I know theres a lot of tweaking possible with MySQL.
Please advise, because I would need a lot of such queries, fetching
through JSP, and displaying them in a presentable form.

Table Structure is as Follows:

Journal Created By  varchar(255)   No  
Case Substatus ID  varchar(255)   Yes  NULL
Case Status ID  varchar(255)   Yes  NULL
Call Rep Employee Name  varchar(255)   Yes  NULL
Call Rep Employee ID  varchar(10)   Yes  NULL
Call Rep DPS Login ID  varchar(10)   Yes  NULL
Call Rep Profile ID  varchar(15)   Yes  NULL
Call Rep Section Code  varchar(15)   Yes  NULL
Call Rep Country Code  char(3)   Yes  NULL
Journal Create Date  date   No  -00-00
Journal Create Time  time   Yes  NULL
Call Svc Tag ID  varchar(255)   Yes  NULL
Order Num of Svc Tag  varchar(255)   Yes  NULL   

Indexes: 

Keyname Type Cardinality Action Field 
Journal Created By  INDEX  None   Journal Created By  
Call Rep Employee ID  INDEX  None   Call Rep Employee ID  
Call Rep DPS Login ID  INDEX  None   Call Rep DPS Login ID  
Call Rep Profile ID  INDEX  None   Call Rep Profile ID  
Call Rep Country Code  INDEX  None   Call Rep Country Code  
Journal Create Time  INDEX  None   Journal Create Time  
Journal Create Date  INDEX  None   Journal Create Date  
Call Svc Tag ID  INDEX  None   Call Svc Tag ID  

Regards,
Amit Wadhwa,
Data Analyst



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: export to csv or excel

2004-04-15 Thread Amit_Wadhwa
Use phpmyadmin.
Damn good for data dump in any format you wish...


-Original Message-
From: Bart De Man [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 15, 2004 6:59 AM
To: [EMAIL PROTECTED]
Subject: export to csv or excel

Hi,

Do you know a good tool to export mysql tables to csv or excel files? It
should be able to run on a Linux system, and should be able to be
scheduled (cron job).
I worked with EMS Mysql Export on a Windows system, this worked fine,
but I can't get it to work on the Linux system.
I also tried with SELECT ... INTO OUTFILE ... but this gives problems
when there are end-of-line characters in the data.

Thanks,

Bart



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Reinstall Windows.

2004-04-13 Thread Amit_Wadhwa
Backup the data folder under the mysql folder, that's it
 

-Original Message-
From: Alejandro C. Garrammone [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 12, 2004 10:11 AM
To: MySQL Mailing List
Subject: Reinstall Windows.

I need to re-install windows, so I need to re-install mysql. How can I
backup my databases so when I reinstall mysql put them to work again?,

Thx in advance,

Alex


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]