Optimizing a query

2008-02-29 Thread Chris W
I was wondering if someone could tell me what things I might need to do to make this query as fast as possible. I am developing a web site where users will have access to certain things based on what groups they are in and what groups have access to certain things. There are several

Re: Optimizing a query

2008-02-29 Thread Dan Buettner
Chris, this should already be pretty fast as it is using a primary key in its entirety, and as long as the index size remains manageable MySQL will be able to keep it in memory for fast access. That said, doing away with the aggregate function might speed things up just slightly. You don't care

RE: Help optimizing this query?

2007-01-08 Thread Michael Gargiullo
-Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Sunday, January 07, 2007 1:12 PM To: mysql Subject: Help optimizing this query? This is the query that's killing me in the slow query log, usually taking around 20 seconds: select count(ip) as counted,stamp from

Re: Help optimizing this query?

2007-01-08 Thread Dan Buettner
Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Sunday, January 07, 2007 1:12 PM To: mysql Subject: Help optimizing this query? This is the query that's killing me in the slow query log, usually taking around 20 seconds: select count(ip) as counted,stamp from ip_addr where stamp=NOW

Re: Help optimizing this query?

2007-01-08 Thread joce
optimizing this query? This is the query that's killing me in the slow query log, usually taking around 20 seconds: select count(ip) as counted,stamp from ip_addr where stamp=NOW()- interval 14 day and source='sometext' group by stamp order by stamp desc; Here is the table: CREATE TABLE

Help optimizing this query?

2007-01-07 Thread Brian Dunning
This is the query that's killing me in the slow query log, usually taking around 20 seconds: select count(ip) as counted,stamp from ip_addr where stamp=NOW()- interval 14 day and source='sometext' group by stamp order by stamp desc; Here is the table: CREATE TABLE `ip_addr` ( `ip`

Re: Help optimizing this query?

2007-01-07 Thread Daniel Kasak
Brian Dunning wrote: This is the query that's killing me in the slow query log, usually taking around 20 seconds: select count(ip) as counted,stamp from ip_addr where stamp=NOW()-interval 14 day and source='sometext' group by stamp order by stamp desc; Here is the table: CREATE TABLE

Help optimizing Fulltext query

2005-08-31 Thread Andrew Brosnan
Hello, I need some help optimizing a query. The current query is as follows: SELECT *, MATCH(title) AGAINST ( 'S' IN BOOLEAN MODE ) AS score FROM articles WHERE MATCH(title) AGAINST ( 'S' IN BOOLEAN MODE ); 'title' is a FULLTEXT index. 'S' is a query string that may have 100 search

Re: Help optimizing Fulltext query

2005-08-31 Thread Brent Baisley
Brosnan wrote: Hello, I need some help optimizing a query. The current query is as follows: SELECT *, MATCH(title) AGAINST ( 'S' IN BOOLEAN MODE ) AS score FROM articles WHERE MATCH(title) AGAINST ( 'S' IN BOOLEAN MODE ); 'title' is a FULLTEXT index. 'S' is a query string that may have

can you help me optimizing this query?

2004-07-12 Thread Giulio
Hi all, I have an audio tracks info table, let's call it Tracks; every Track can have one or more ' Character' ( it is not a genre, it is something like 'Italian' or 'International' or '80's' or 'evergreen' ) so a track can be 'International' and 'Evergreen', or 'Italian' and '70's') I have

Re: can you help me optimizing this query?

2004-07-12 Thread David Scott
list wont change that often? should be ok. -- Dave - Original Message - From: Giulio [EMAIL PROTECTED] To: MySQL List [EMAIL PROTECTED] Sent: Monday, July 12, 2004 1:50 PM Subject: can you help me optimizing this query? Hi all, I have an audio tracks info table, let's call it Tracks

Re: can you help me optimizing this query?

2004-07-12 Thread Giulio
I've found a solution so I'm answering to myself, for who can be interested and for asking if I've done something that could affect on some way my DB performances. I've added an index to both the columns that I use for the ON clause of my left join query, and now it runs at the speed of

Re: can you help me optimizing this query?

2004-07-12 Thread SGreen
to: | | Subject: can you help me optimizing this query

Re: can you help me optimizing this query?

2004-07-12 Thread SGreen
: | | Fax to: | | Subject: Re: can you help me optimizing this query

Optimizing a query

2003-08-21 Thread gord barq
I have this query which does a left outer join and it takes forever (like half a day). Here are the results of an explain analysis. mysql explain SELECT count(searchresult.title) AS number, campaigntrack.title, tracknum, trackid FROM campaigntrack LEFT OUTER JOIN searchresult ON

Re: Optimizing a query

2003-08-21 Thread Jon Drukman
gord barq wrote: I have this query which does a left outer join and it takes forever (like half a day). Here are the results of an explain analysis. mysql explain SELECT count(searchresult.title) AS number, campaigntrack.title, tracknum, trackid FROM campaigntrack LEFT OUTER JOIN searchresult

Re: Optimizing a query

2003-08-21 Thread Jeremy Zawodny
On Thu, Aug 21, 2003 at 01:03:16AM +, gord barq wrote: I have this query which does a left outer join and it takes forever (like half a day). Here are the results of an explain analysis. mysql explain SELECT count(searchresult.title) AS number, campaigntrack.title, tracknum, trackid

Trouble optimizing a query

2003-06-07 Thread lists
Hello everyone, I'm working with MySQL 3.23.41-log developing a chat application. I need to run a query, order the results in descending order, then get the last 0-15 entries that are less than 20 minutes old. The query and tables in question are explained at the bottom of this posting. In

Re: Trouble optimizing a query

2003-06-07 Thread Paul DuBois
At 22:29 +0200 6/7/03, [EMAIL PROTECTED] wrote: Hello everyone, I'm working with MySQL 3.23.41-log developing a chat application. I need to run a query, order the results in descending order, then get the last 0-15 entries that are less than 20 minutes old. The query and tables in question

Re: Trouble optimizing a query

2003-06-07 Thread lists
On Sat, 7 Jun 2003 15:33 , Paul DuBois [EMAIL PROTECTED] sent: This is a problem that is fixed in MySQL 4. If you can upgrade, that should help you a lot. http://www.mysql.com/doc/en/News-4.0.0.html That explains that. I was relying on the online docs and it didn't even occur to me that

Re: Trouble optimizing a query

2003-06-07 Thread Becoming Digital
] Sent: Saturday, 07 June, 2003 17:28 Subject: Re: Trouble optimizing a query On Sat, 7 Jun 2003 15:33 , Paul DuBois [EMAIL PROTECTED] sent: This is a problem that is fixed in MySQL 4. If you can upgrade, that should help you a lot. http://www.mysql.com/doc/en/News-4.0.0.html That explains

question on optimizing complex query

2002-11-25 Thread Steve Yates
Hello, I am relatively new to MySQL though I have database experience. I have a query that doesn't seem to want to use an index for the first table despite my indexing several fields. Before I get too far in the details of the query, here is what EXPLAIN SELECT tells me for the first

optimizing OR query

2002-04-25 Thread Myk Melez
How do I optimize the following query? SELECT foo.id FROM foo, bar WHERE foo.id = bar.foo_id AND foo.field = 'baz' OR bar.field = 'baz'; Only a small number of records from each table match the query conditions, but MySQL takes forever to execute it. No wonder, when EXPLAIN says it needs to

Re: optimizing OR query

2002-04-25 Thread Myk Melez
[EMAIL PROTECTED] wrote: The form Select foo.id From foo, bar... is giving you a cross-product. A cross-product emits a row for every combination of rows from each of your tables. The Explain results seem to be consistent with this. What I'd suggest is that you try a Join on your tables. Thanks

Need help optimizing a query

2002-02-13 Thread david
I need to optimize the following query: SELECT user, sum(in), sum(out) FROM stats WHERE from='20020205' AND to='20020206' GROUP BY user; In,out are bigint, user is varcher(20) and from,to are timestamp And I want to speed up this type of query, but I have not been able to to get it to use an

Re: Optimizing mySQL and Optimizing this query

2002-01-24 Thread Jeremy Zawodny
On Tue, Jan 22, 2002 at 10:12:55AM -0600, Solsberry, Glendon wrote: I have mySQL v3.23 running on a Mandrake 8.1 box (AMD 1600XP, 512MB RAM). The problem is that the main query (listed below) takes approximately 3 hours to run. [snip] Wow! Thanks for all the detail. The query is this:

Optimizing mySQL and Optimizing this query

2002-01-22 Thread Solsberry, Glendon
I have mySQL v3.23 running on a Mandrake 8.1 box (AMD 1600XP, 512MB RAM). The problem is that the main query (listed below) takes approximately 3 hours to run. my.cnf looks like: [mysqld] port= 3306 socket = /tmp/mysql.sock skip-locking set-variable= key_buffer=128M

Optimizing a query with a new index

2001-05-29 Thread Iago Sineiro
Hi all. I want to optimize a query that is executed often in the application we use at work. NOTE: Excuse me for using spanish names for the tables and the columns. In the database we have three tables for article: ARTICULOINFO (information of an article), LARTICULOINFO_IDIOMA (information of