Re: MySQL optimization for testing purpose

2018-04-04 Thread Sebastien FLAESCH

On 04/03/2018 06:15 PM, Sebastien FLAESCH wrote:

On 04/03/2018 05:59 PM, Sebastien FLAESCH wrote:

Hi all,

Looking for some configuration tips to speed execution of our non-regression 
tests with MySQL.

We do pure functional testing, data persistence is not critical.

Our tests are not using a lot of data, but we create and drop a lot of test 
tables.

We have concurrency tests (processes locking rows), so this feature matters.

Are there some InnoDB params to enable or disable to speed up our tests?

Some tests behave a bit strange, sometimes one of our test takes 1 min 30 secs, 
sometimes
it takes only 15 seconds...


In fact this tests creates and drops ~150 times the same table, having a single 
column
using different types each time.

I can clearly see that sometimes table creations are fast, but from time to 
time it
slows down to about a second to create a table.



How can this happen?

Any log I could enable and provide here?

Thanks in advance!
Seb






FYI, have tried following settings, but it did not help:

innodb_stats_auto_recalc=0
innodb_file_per_table=0
innodb_stats_persistent=0

I have recreated my database after restarting the server.

Server version: 8.0.4-rc-log MySQL Community Server (GPL)

Seb

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



Re: MySQL optimization for testing purpose

2018-04-03 Thread Sebastien FLAESCH

On 04/03/2018 05:59 PM, Sebastien FLAESCH wrote:

Hi all,

Looking for some configuration tips to speed execution of our non-regression 
tests with MySQL.

We do pure functional testing, data persistence is not critical.

Our tests are not using a lot of data, but we create and drop a lot of test 
tables.

We have concurrency tests (processes locking rows), so this feature matters.

Are there some InnoDB params to enable or disable to speed up our tests?

Some tests behave a bit strange, sometimes one of our test takes 1 min 30 secs, 
sometimes
it takes only 15 seconds...


In fact this tests creates and drops ~150 times the same table, having a single 
column
using different types each time.

I can clearly see that sometimes table creations are fast, but from time to 
time it
slows down to about a second to create a table.



How can this happen?

Any log I could enable and provide here?

Thanks in advance!
Seb




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



MySQL optimization for testing purpose

2018-04-03 Thread Sebastien FLAESCH

Hi all,

Looking for some configuration tips to speed execution of our non-regression 
tests with MySQL.

We do pure functional testing, data persistence is not critical.

Our tests are not using a lot of data, but we create and drop a lot of test 
tables.

We have concurrency tests (processes locking rows), so this feature matters.

Are there some InnoDB params to enable or disable to speed up our tests?

Some tests behave a bit strange, sometimes one of our test takes 1 min 30 secs, 
sometimes
it takes only 15 seconds...

How can this happen?

Any log I could enable and provide here?

Thanks in advance!
Seb

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



Re: best mysql optimization tutorial and/or quick start guide?

2009-03-16 Thread David M. Karr

John G. Heim wrote:


- Original Message - From: "Darryle Steplight" 


To: "Stephen Edberg" 
Cc: "John G. Heim" ; 
Sent: Thursday, March 05, 2009 12:53 PM
Subject: Re: best mysql optimization tutorial and/or quick start guide?


High Performance MySql "Optimization, Backups, Replication, and more"
2nd Edition . Got a problem, pick a chapter and read the solution.
This book is awesome, I'm confident you will find what you are looking
for :) .


Excellent tip. It's exactly what I'm looking for. Well, I guess I 
wouldn't exactly call it a quick start guide. But by chance, it 
happened to be on bookshare.org. This is a web site which, if you're 
blind, you can subscribe to to download e-books. I'm already 
subscribed so I didn't have to pay any additional price for this 
particular book.  Must be my lucky day.


This book is also available on the Safari edition associated with ACM 
memberships.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: best mysql optimization tutorial and/or quick start guide?

2009-03-16 Thread John G. Heim


- Original Message - 
From: "Darryle Steplight" 

To: "Stephen Edberg" 
Cc: "John G. Heim" ; 
Sent: Thursday, March 05, 2009 12:53 PM
Subject: Re: best mysql optimization tutorial and/or quick start guide?


High Performance MySql "Optimization, Backups, Replication, and more"
2nd Edition . Got a problem, pick a chapter and read the solution.
This book is awesome, I'm confident you will find what you are looking
for :) .


Excellent tip. It's exactly what I'm looking for. Well, I guess I wouldn't 
exactly call it a quick start guide. But by chance, it happened to be on 
bookshare.org. This is a web site which, if you're blind, you can subscribe 
to to download e-books. I'm already subscribed so I didn't have to pay any 
additional price for this particular book.  Must be my lucky day.






--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: best mysql optimization tutorial and/or quick start guide?

2009-03-05 Thread Darryle Steplight
High Performance MySql "Optimization, Backups, Replication, and more"
2nd Edition . Got a problem, pick a chapter and read the solution.
This book is awesome, I'm confident you will find what you are looking
for :) .

On Thu, Mar 5, 2009 at 12:30 PM, Stephen Edberg  wrote:
>
>> I've been poking around google looking for tutorials and/or quick start
>> guides on optimizing the mysql server. We just upgraded our DB server from
>> 2
>> Gb of RAM to 16. But I don't know how to reconfigure mysql to take full
>> advantage of it. Although, just installing the RAM seems to have made a
>> huge
>> difference.
>>
>> Any suggestions for a really good tutorial on configuring the server based
>>
>> on the amount of RAM, etc?
>
>
> Hard to give details on performance optimization without knowing more about
> the details for your load, but there are a number of cache-related
> parameters (query cache, key cache and so on) that could be increased to
> take optimum advantage of the additional RAM.
>
> Take a look at
>
>     http://www.mysqlperformanceblog.com/
>
> The name is pretty self-explanatory, and there's a lot of useful info there
> on mysql tuning. They are the authors of 'High Performance MySQL' -
>
>     http://oreilly.com/catalog/9780596101718/index.html
>
> - which I've heard good things about (don't have it myself, plan to buy).
> Also see
>
>     http://dev.mysql.com/doc/refman/5.0/en/optimization.html
>
> (assuming you use 5.0; substitute appropriate version if otherwise).
>
>     - steve edberg
>
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=dstepli...@gmail.com
>
>

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



RE: best mysql optimization tutorial and/or quick start guide?

2009-03-05 Thread Stephen Edberg

> I've been poking around google looking for tutorials and/or quick start 
> guides on optimizing the mysql server. We just upgraded our DB server from
> 2 
> Gb of RAM to 16. But I don't know how to reconfigure mysql to take full 
> advantage of it. Although, just installing the RAM seems to have made a
> huge 
> difference.
> 
> Any suggestions for a really good tutorial on configuring the server based
> 
> on the amount of RAM, etc?


Hard to give details on performance optimization without knowing more about
the details for your load, but there are a number of cache-related
parameters (query cache, key cache and so on) that could be increased to
take optimum advantage of the additional RAM.

Take a look at

 http://www.mysqlperformanceblog.com/

The name is pretty self-explanatory, and there's a lot of useful info there
on mysql tuning. They are the authors of 'High Performance MySQL' -

 http://oreilly.com/catalog/9780596101718/index.html

- which I've heard good things about (don't have it myself, plan to buy).
Also see

 http://dev.mysql.com/doc/refman/5.0/en/optimization.html

(assuming you use 5.0; substitute appropriate version if otherwise).

 - steve edberg




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: best mysql optimization tutorial and/or quick start guide?

2009-03-05 Thread Walter Heck
Configuring and optimising a MySQL server is highly dependent on your usage
of it. The most important question for you now is probably: which storage
engines do you use? Based on that, you should start configuring MySQL to
assign memory to optimise the usage of each as good as possible.

Have fun!

Walter

OlinData: Professional services for MySQL
Support * Consulting * Administration
http://www.olindata.com


On Thu, Mar 5, 2009 at 5:38 PM, John G. Heim  wrote:

> I've been poking around google looking for tutorials and/or quick start
> guides on optimizing the mysql server. We just upgraded our DB server from 2
> Gb of RAM to 16. But I don't know how to reconfigure mysql to take full
> advantage of it. Although, just installing the RAM seems to have made a huge
> difference.
>
> Any suggestions for a really good tutorial on configuring the server based
> on the amount of RAM, etc?
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/mysql?unsub=li...@olindata.com
>
>


best mysql optimization tutorial and/or quick start guide?

2009-03-05 Thread John G. Heim
I've been poking around google looking for tutorials and/or quick start 
guides on optimizing the mysql server. We just upgraded our DB server from 2 
Gb of RAM to 16. But I don't know how to reconfigure mysql to take full 
advantage of it. Although, just installing the RAM seems to have made a huge 
difference.


Any suggestions for a really good tutorial on configuring the server based 
on the amount of RAM, etc?




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: mysql optimization tips

2009-02-10 Thread Baron Schwartz
> You can read a few pages from High Performance MySQL 1st edition at
> http://books.google.ca/books?id=sgMvu2uZXlsC&printsec=frontcover&dq=mysql+high+performance#PPP1,M1
> Google Books also has excerpts from other MySQL books.

You can also get the Query Optimization chapter online as a PDF from
http://www.highperfmysql.com

Why didn't I think of that before :)

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: mysql optimization tips

2009-02-10 Thread mos

At 06:44 PM 2/10/2009, Michael Dykman wrote:

On Tue, Feb 10, 2009 at 7:23 PM, Baron Schwartz  wrote:
> Hi,
>
> On Tue, Feb 10, 2009 at 9:25 AM, monloi perez  wrote:
>> Hi All,
>>
>> I'm not sure if this question is fine, I'm new to the list and I just 
have one very important question.
>> Can anyone help me suggest the right optimization for our company's 
server.

>
> I suggest High Performance MySQL, Second Edition :-)  There's no way
> to really give any good advice without knowing what you use the server
> for.
>

I enthusiastically second that recommendation


You can read a few pages from High Performance MySQL 1st edition at 
http://books.google.ca/books?id=sgMvu2uZXlsC&printsec=frontcover&dq=mysql+high+performance#PPP1,M1

Google Books also has excerpts from other MySQL books.

Mike


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: mysql optimization tips

2009-02-10 Thread Michael Dykman
On Tue, Feb 10, 2009 at 7:23 PM, Baron Schwartz  wrote:
> Hi,
>
> On Tue, Feb 10, 2009 at 9:25 AM, monloi perez  wrote:
>> Hi All,
>>
>> I'm not sure if this question is fine, I'm new to the list and I just have 
>> one very important question.
>> Can anyone help me suggest the right optimization for our company's server.
>
> I suggest High Performance MySQL, Second Edition :-)  There's no way
> to really give any good advice without knowing what you use the server
> for.
>

I enthusiastically second that recommendation


-- 
 - michael dykman
 - mdyk...@gmail.com

 - All models are wrong.  Some models are useful.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: mysql optimization tips

2009-02-10 Thread Baron Schwartz
Hi,

On Tue, Feb 10, 2009 at 9:25 AM, monloi perez  wrote:
> Hi All,
>
> I'm not sure if this question is fine, I'm new to the list and I just have 
> one very important question.
> Can anyone help me suggest the right optimization for our company's server.

I suggest High Performance MySQL, Second Edition :-)  There's no way
to really give any good advice without knowing what you use the server
for.


-- 
Baron Schwartz, Director of Consulting, Percona Inc.
Our Blog: http://www.mysqlperformanceblog.com/
Our Services: http://www.percona.com/services.html

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



mysql optimization tips

2009-02-10 Thread monloi perez
Hi All,

I'm not sure if this question is fine, I'm new to the list and I just have one 
very important question.
Can anyone help me suggest the right optimization for our company's server.

Our current server is a Dell PowerEdge 1900 a QuadCore with 1TB total (Raid 1) 
of HD space and 4G RAM.
The company is 300 seater callcenter with around 2000 Transactions 
(inserts/updates internally and externally) per day.

Any help would be much appreciated.

Here is our current mysql config file.

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-bdb
sort_buffer_size=128M
query_cache_size=8M
key_buffer=256M
join_buffer_size=128M
#to be changed to lesser than 2M based on this site
#http://www.mysqlperformanceblog.com/2007/09/17/mysql-what-read_buffer_size-value-is-optimal/
read_buffer_size=2M
read_rnd_buffer_size=2M
max_allowed_packet=4M
table_cache=256
thread_cache_size=64
old_passwords=1

# increase the max_connection and connect_timeout
max_connections=600
max_connect_errors=20
connect_timeout=60

# set the option for starting mysqld
log_slow_queries=/var/log/mysqld.slow.log
log-bin=localhost-bin
sysdate-is-now

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[myisamchk]
key_buffer=128M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

Thanks,
Mon


  

mysql optimization

2008-07-03 Thread Mesut GÜLNAZ
i am looking for mysql 5.0 optimization documents on FreeBSD 6.3-stable.

I tried to install "mytop" to see the running style of the system but
p5-DBD-mysql has been failed coz of many bugs.

And also read this section
http://dev.mysql.com/doc/refman/5.0/en/mysql-benchmarks.html . do you have
any advice for me to make better the performance of mysql on my bsd box.

 

People says that: mysql is much more better on linux boxes then bsd boxes.
Coz of linux threads style. My bsd box has linux compatibility.

 

linux_base-fc-4_13  Base set of packages needed in Linux mode (for
i386/amd64)

linuxthreads-2.2.3_23 POSIX pthreads implementation using rfork to generate
kerne

 

is it true? Or can i say that no you r wrong.!!

 

Thanks for your help...



Re: MySQL Optimization error ?

2006-04-20 Thread David Griffiths

This isn't a bug, it's a missing feature. The parent query won't use indexes, 
just the subquery.

There's been a lot of complaints about how it renders sub queries less than 
useful.

I seem to remember that it might be fixed in 5.1, but I'm not a reliable source 
of info on this.

David



Dyego Souza Dantas Leal wrote:

I have a good question, the MySQL Optimizer is broker ? see the querys:


mysql> explain select * from an where an_id in (100,200);
++-+---+---+---+---+-+--+--+-+ 

| id | select_type | table | type  | possible_keys | key   | key_len | 
ref  | rows | Extra   |
++-+---+---+---+---+-+--+--+-+ 

| 1  | SIMPLE  | an| range | An_Id | An_Id | 4   
|  | 2| Using where |
++-+---+---+---+---+-+--+--+-+ 


1 row in set (0.00 sec)


GREAT !!! the MySQL uses primary index to search the rows... BUt , if 
i'm using subselect the response is not good.



mysql> explain select * from an where an_id in (select an_id from an 
where an_id between 100 and 103);
+++---+-+---+---+-+--+--+--+ 

| id | select_type| table | type| possible_keys | 
key   | key_len | ref  | rows | Extra|
+++---+-+---+---+-+--+--+--+ 

| 1  | PRIMARY| an| ALL |   
|   | |  | 2489 | Using where  |
| 2  | DEPENDENT SUBQUERY | an| unique_subquery | An_Id | 
An_Id | 4   | func | 1| Using index; Using where |
+++---+-+---+---+-+--+--+--+ 


2 rows in set (0.00 sec)

mysql>

this is very slow... the MAX return in 0.001s , but the IN CLAUSE not 
use the PRIMARY INDEX , this causes FULL TABLE SCAN !!!


Optimizer is Broken ?

MySQL Version: 5.0.19-pro
Plataform: Windows or Linux box (debian kernel 2.6.14-1)
Memory : 1 GB of RAM
Table Type: InnoDB

Tnks in advance !



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



MySQL Optimization error ?

2006-04-20 Thread Dyego Souza Dantas Leal

I have a good question, the MySQL Optimizer is broker ? see the querys:


mysql> explain select * from an where an_id in (100,200);
++-+---+---+---+---+-+--+--+-+
| id | select_type | table | type  | possible_keys | key   | key_len | 
ref  | rows | Extra   |

++-+---+---+---+---+-+--+--+-+
| 1  | SIMPLE  | an| range | An_Id | An_Id | 4   
|  | 2| Using where |

++-+---+---+---+---+-+--+--+-+
1 row in set (0.00 sec)


GREAT !!! the MySQL uses primary index to search the rows... BUt , if 
i'm using subselect the response is not good.



mysql> explain select * from an where an_id in (select an_id from an 
where an_id between 100 and 103);

+++---+-+---+---+-+--+--+--+
| id | select_type| table | type| possible_keys | 
key   | key_len | ref  | rows | Extra|

+++---+-+---+---+-+--+--+--+
| 1  | PRIMARY| an| ALL |   
|   | |  | 2489 | Using where  |
| 2  | DEPENDENT SUBQUERY | an| unique_subquery | An_Id | 
An_Id | 4   | func | 1| Using index; Using where |

+++---+-+---+---+-+--+--+--+
2 rows in set (0.00 sec)

mysql>

this is very slow... the MAX return in 0.001s , but the IN CLAUSE not 
use the PRIMARY INDEX , this causes FULL TABLE SCAN !!!


Optimizer is Broken ?

MySQL Version: 5.0.19-pro
Plataform: Windows or Linux box (debian kernel 2.6.14-1)
Memory : 1 GB of RAM
Table Type: InnoDB

Tnks in advance !

--



-
++  Dyego Souza Dantas Leal   ++   Dep. Desenvolvimento   
-
  E S C R I B A   I N F O R M A T I C A
   ***http://javacoffe.blogspot.com***
-
The only stupid question is the unasked one (somewhere in Linux's HowTo)
Linux registred user : #230601
--ICQ   : 1647350
$ look into "my eyes" Phone : +55 041 2106-1212


look: cannot open my eyes Fax   : +55 041 3296-6640 
-
Reply: [EMAIL PROTECTED] 



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



Silicon Valley MySQL Meetup: MySQL Optimization, Monday, Feb 13, 2006 @ 7:00pm in Santa Clara, CA

2006-02-07 Thread Jeremy Cole

Hi All,

Are you interested in MySQL?  Do you live/work in Silicon Valley?

Join a fun group of professionals for the monthly MySQL Meetup in 
Silicon Valley, held at Yahoo! in Santa Clara, California.  The topic 
this month is:


  MySQL Optimization and the EXPLAIN command
  Speaker: Jeremy Cole, Yahoo! Inc. (that's me!)

Please sign up and RSVP here, if you plan on attending:

  http://mysql.meetup.com/101/events/4829967/

If you're interested in other topics or decide to join the group, please 
visit the polls and let us know what your skill level is and what topics 
you're interested in:


  http://mysql.meetup.com/101/poll/

If you have any questions about the group or the event, please feel free 
to contact me directly.


See you on Monday!

Regards,

Jeremy

--
Jeremy Cole
MySQL Geek, Yahoo! Inc.
Desk: 408 349 5104

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



Re: MySQL optimization

2002-12-17 Thread Joseph Bueno
Hi,

It seems that you don't have any index on your tables.
You should at least create an index on flObjectID in all tables.
You should also use 'explain' on your query to make sure that
indexes are properly used.

Hope this helps
Joseph Bueno

John Glenn wrote:
> 
> 
> I'm looking for recomendations on improving system performance.  Using
> the SQL command below on a MySQL server I find result times averaging
> three seconds.  Being very inexperienced with database programming I
> would appreciate any comments on whether this is expected behaviour, or
> where my design might improve.  The details of my system are below.
> 
> 
> The data I'm looking for starts with tblItems which holds a list of
> Items we're looking to buy.  I want the name of the item from tblStock,
> and statistics on prices we've found in our history (if they exist).
> I've never done a multi table join before and this is what I've come up
> with:
> 
> 
> 300 Mhz, 32 MB RAM
> CPU: 65% idle, RAM: 12MB Free
> OS: Slackware Linux 8.1 (2.4.18)
> Mysqld Ver 3.23.53a for pc-linux-gnu on i686
> 
> mysql> select fldName, fldQuantity, fldTotalCost,
> tblntItems.fldObjectID, avg(fldQuote), count(fldQuote), max(fldQuote),
> min(fldQuote) from tblStock, tblntItems left join tblntQuotes on
> tblntItems.fldObjectID = tblntQuotes.fldObjectID where
> tblntItems.fldObjectID = tblStock.fldObjectID group by fldObjectID;
> 
> 
> 
> mysql> show fields from tblStock;
> +-+--+--+-+-+---+
> | Field   | Type | Null | Key | Default | Extra |
> +-+--+--+-+-+---+
> | fldObjectID | int(11)  | YES  | | NULL|   |
> | fldName | varchar(255) | YES  | | NULL|   |
> | fldCost | int(11)  | YES  | | NULL|   |
> | fldRetail   | int(11)  | YES  | | NULL|   |
> | fldUpdate   | varchar(255) | YES  | | NULL|   |
> +-+--+--+-+-+---+
> 5 rows in set (0.00 sec)
> aprox 7000 items.
> 
> 
> 
> mysql> show fields from tblntQuotes;
> +-+-+--+-+-+---+
> | Field   | Type| Null | Key | Default | Extra |
> +-+-+--+-+-+---+
> | fldObjectID | int(11) | YES  | | NULL|   |
> | fldDate | date| YES  | | NULL|   |
> | fldSource   | int(11) | YES  | | NULL|   |
> | fldQuote| double  | YES  | | NULL|   |
> +-+-+--+-+-+---+
> 4 rows in set (0.00 sec)
> approx 130 records.
> 
> 
> mysql> show fields from tblntItems;
> +--+-+--+-+-+---+
> | Field| Type| Null | Key | Default | Extra |
> +--+-+--+-+-+---+
> | fldObjectID  | int(11) | YES  | | NULL|   |
> | fldQuantity  | int(11) | YES  | | NULL|   |
> | fldTotalCost | double  | YES  | | NULL|   |
> +--+-+--+-+-+---+
> 3 rows in set (0.00 sec)
> approx 100 records.
> 
> 
> Regards,
> 
> John Glenn
> 
> 


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




MySQL optimization

2002-12-16 Thread John Glenn


I'm looking for recomendations on improving system performance.  Using 
the SQL command below on a MySQL server I find result times averaging 
three seconds.  Being very inexperienced with database programming I 
would appreciate any comments on whether this is expected behaviour, or 
where my design might improve.  The details of my system are below.


The data I'm looking for starts with tblItems which holds a list of 
Items we're looking to buy.  I want the name of the item from tblStock, 
and statistics on prices we've found in our history (if they exist). 
I've never done a multi table join before and this is what I've come up 
with:


300 Mhz, 32 MB RAM
CPU: 65% idle, RAM: 12MB Free
OS: Slackware Linux 8.1 (2.4.18)
Mysqld Ver 3.23.53a for pc-linux-gnu on i686

mysql> select fldName, fldQuantity, fldTotalCost, 
tblntItems.fldObjectID, avg(fldQuote), count(fldQuote), max(fldQuote), 
min(fldQuote) from tblStock, tblntItems left join tblntQuotes on 
tblntItems.fldObjectID = tblntQuotes.fldObjectID where 
tblntItems.fldObjectID = tblStock.fldObjectID group by fldObjectID;



mysql> show fields from tblStock;
+-+--+--+-+-+---+
| Field   | Type | Null | Key | Default | Extra |
+-+--+--+-+-+---+
| fldObjectID | int(11)  | YES  | | NULL|   |
| fldName | varchar(255) | YES  | | NULL|   |
| fldCost | int(11)  | YES  | | NULL|   |
| fldRetail   | int(11)  | YES  | | NULL|   |
| fldUpdate   | varchar(255) | YES  | | NULL|   |
+-+--+--+-+-+---+
5 rows in set (0.00 sec)
aprox 7000 items.



mysql> show fields from tblntQuotes;
+-+-+--+-+-+---+
| Field   | Type| Null | Key | Default | Extra |
+-+-+--+-+-+---+
| fldObjectID | int(11) | YES  | | NULL|   |
| fldDate | date| YES  | | NULL|   |
| fldSource   | int(11) | YES  | | NULL|   |
| fldQuote| double  | YES  | | NULL|   |
+-+-+--+-+-+---+
4 rows in set (0.00 sec)
approx 130 records.


mysql> show fields from tblntItems;
+--+-+--+-+-+---+
| Field| Type| Null | Key | Default | Extra |
+--+-+--+-+-+---+
| fldObjectID  | int(11) | YES  | | NULL|   |
| fldQuantity  | int(11) | YES  | | NULL|   |
| fldTotalCost | double  | YES  | | NULL|   |
+--+-+--+-+-+---+
3 rows in set (0.00 sec)
approx 100 records.


Regards,

John Glenn


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php