Re: Help with a query

2011-05-20 Thread Anupam Karmarkar
, digest HAVING Sum(Cnt) (Select sum(refcount) from C WHERE tmp.file = C.file and tmp.digest = C.digest); --Anupam --- On Tue, 17/5/11, Aveek Misra ave...@yahoo-inc.com wrote: From: Aveek Misra ave...@yahoo-inc.com Subject: Help with a query To: mysql@lists.mysql.com mysql@lists.mysql.com Date

Re: Help with a query

2011-05-20 Thread Aveek Misra
and tmp.digest = C.digest); --Anupam --- On Tue, 17/5/11, Aveek Misra ave...@yahoo-inc.commailto:ave...@yahoo-inc.com wrote: From: Aveek Misra ave...@yahoo-inc.commailto:ave...@yahoo-inc.com Subject: Help with a query To: mysql@lists.mysql.commailto:mysql@lists.mysql.com mysql

Help with a query

2011-05-17 Thread Aveek Misra
I have a table A and table B of the same type as CREATE TABLE A ( `file` varbinary(255) not null, `digest` binary(40) not null ) CREATE TABLE B ( `file` varbinary(255) not null, `digest` binary(40) not null ) I have another table C of the following type CREATE TABLE C (

Re: Help with slow query

2011-03-10 Thread Jim McNeely
? On Mar 9, 2011, at 8:34 PM, Shawn Green (MySQL) wrote: Hi Jim, On 3/9/2011 17:57, Jim McNeely wrote: I am trying to set up an export query which is executing very slowly, and I was hoping I could get some help. Here is the query: SELECT a.IdAppt, a.IdPatient, p.NameLast, p.NameFirst

Re: Help with slow query

2011-03-10 Thread Jim McNeely
a POSSIBLE key, right? On Mar 9, 2011, at 8:34 PM, Shawn Green (MySQL) wrote: Hi Jim, On 3/9/2011 17:57, Jim McNeely wrote: I am trying to set up an export query which is executing very slowly, and I was hoping I could get some help. Here is the query: SELECT a.IdAppt, a.IdPatient, p.NameLast

Re: Help with slow query

2011-03-10 Thread mos
` (`NameLast`) So, the IdPatient is at least a POSSIBLE key, right? On Mar 9, 2011, at 8:34 PM, Shawn Green (MySQL) wrote: Hi Jim, On 3/9/2011 17:57, Jim McNeely wrote: I am trying to set up an export query which is executing very slowly, and I was hoping I could get some help. Here

Re: Help with slow query

2011-03-10 Thread Shawn Green (MySQL)
On 3/10/2011 12:32, Jim McNeely wrote: Rhino, Thanks for the help and time! Actually, I thought the same thing, but what's weird is that is the only thing that doesn't slow it down. If I take out all of the join clauses EXCEPT that one the query runs virtually instantaneously. for some

Re: Help with slow query

2011-03-10 Thread Jim McNeely
Shawn, This is the first thing that I though as well, but here is a portion from the show create table for patient_: PRIMARY KEY (`zzk`), KEY `IdPatient` (`IdPatient`), KEY `SSN` (`SSN`), KEY `IdLastword` (`IdLastword`), KEY `DOB` (`DateOfBirth`), KEY `NameFirst` (`NameFirst`), KEY

Re: Help with slow query

2011-03-10 Thread Shawn Green (MySQL)
On 3/10/2011 13:12, Jim McNeely wrote: Shawn, This is the first thing that I though as well, but here is a portion from the show create table for patient_: PRIMARY KEY (`zzk`), KEY `IdPatient` (`IdPatient`), KEY `SSN` (`SSN`), KEY `IdLastword` (`IdLastword`), KEY `DOB`

Re: Help with slow query

2011-03-10 Thread Andy Wallace
On 3/10/11 10:46 AM, Shawn Green (MySQL) wrote: On 3/10/2011 12:32, Jim McNeely wrote: Rhino, Thanks for the help and time! Actually, I thought the same thing, but what's weird is that is the only thing that doesn't slow it down. If I take out all of the join clauses EXCEPT that one the

Help with slow query

2011-03-09 Thread Jim McNeely
I am trying to set up an export query which is executing very slowly, and I was hoping I could get some help. Here is the query: SELECT a.IdAppt, a.IdPatient, p.NameLast, p.NameFirst, p.NameMI, a.IdProcedure, a.ProcName, CAST(CONCAT(a.ApptDate, , a.ApptTimeOut) AS CHAR) ApptDateTime

Re: Help with slow query

2011-03-09 Thread Shawn Green (MySQL)
Hi Jim, On 3/9/2011 17:57, Jim McNeely wrote: I am trying to set up an export query which is executing very slowly, and I was hoping I could get some help. Here is the query: SELECT a.IdAppt, a.IdPatient, p.NameLast, p.NameFirst, p.NameMI, a.IdProcedure, a.ProcName, CAST(CONCAT(a.ApptDate

Re: Need Help Writing Simple Query

2010-07-26 Thread Mark Phillips
; - test1 table: col1v_idh_id America 1 2 - test2 table: id name 2 SAM 1 UNCLE - Original Message - From: Mark Phillips m...@phillipsmarketing.biz To: Mysql List mysql@lists.mysql.com Sent: Monday, July 26, 2010 8:29:00 AM Subject: Need Help Writing

Need Help Writing Simple Query

2010-07-25 Thread Mark Phillips
I have been away from sql for awhile, and can't seem to figure out how to write a simple query for two tables. Table 1 has many columns, two of which are hID and vID. Table 2 has two columns, ID and name. The hID and vID in table 1 correspond to the IDs in table 2. I want to make a query so I get

Re: Need Help Writing Simple Query

2010-07-25 Thread Nguyen Manh Cuong
SAM 1 UNCLE - Original Message - From: Mark Phillips m...@phillipsmarketing.biz To: Mysql List mysql@lists.mysql.com Sent: Monday, July 26, 2010 8:29:00 AM Subject: Need Help Writing Simple Query I have been away from sql for awhile, and can't seem to figure out how to write

Re: Need Help Writing Simple Query

2010-07-25 Thread John List
On 07/25/2010 09:29 PM, Mark Phillips wrote: I have been away from sql for awhile, and can't seem to figure out how to write a simple query for two tables. Table 1 has many columns, two of which are hID and vID. Table 2 has two columns, ID and name. The hID and vID in table 1 correspond to the

Help needed on query on multiple tables

2010-06-03 Thread Michael Stroh
Hi everyone. I'm trying to create a certain MySQL query but I'm not sure how to do it. Here is a stripped down version of the result I'm aiming for. I'm pretty new to queries that act on multiple tables, so apologize if this is a very stupid question. I have one table (data) that has two

RE: Help needed on query on multiple tables

2010-06-03 Thread Steven Staples
To: MySql Subject: Help needed on query on multiple tables Hi everyone. I'm trying to create a certain MySQL query but I'm not sure how to do it. Here is a stripped down version of the result I'm aiming for. I'm pretty new to queries that act on multiple tables, so apologize

Re: Help needed on query on multiple tables

2010-06-03 Thread Michael Stroh
-Original Message- From: Michael Stroh [mailto:st...@astroh.org] Sent: June 3, 2010 11:24 AM To: MySql Subject: Help needed on query on multiple tables Hi everyone. I'm trying to create a certain MySQL query but I'm not sure how to do it. Here is a stripped down version

RE: Help needed on query on multiple tables

2010-06-03 Thread Steven Staples
...@astroh.org] Sent: June 3, 2010 11:55 AM To: Steven Staples Cc: 'MySql' Subject: Re: Help needed on query on multiple tables Thanks! That did it perfectly! Michael On Jun 3, 2010, at 11:45 AM, Steven Staples wrote: How about this? SELECT `first_table`.`names

Re: Help with mysql query, multiple list

2009-05-10 Thread Scott Haneda
What about sub selects. As I see it you only care about the highest and lowest order of results in each list. Sorry, in am on a mobile so I can nit make a test case, and this will be pseudo SQL. Select * from table where start = (select foo) and ( select foo) ... Also look at the between

Re: Help with mysql query, multiple list

2009-05-09 Thread Simon J Mudd
abhishek@gmail.com (Abhishek Pratap) writes: I am kind of stuck with this query , cant expand my thinking. May this is a limitation. Here it is I have a database with many cols two of which are start and end position for an event. Now I have a list of event time stamps, I want to

Help with mysql query, multiple list

2009-05-08 Thread Abhishek Pratap
Hi All I am kind of stuck with this query , cant expand my thinking. May this is a limitation. Here it is I have a database with many cols two of which are start and end position for an event. Now I have a list of event time stamps, I want to find all the info once the current event time

Re: Help with mysql query, multiple list

2009-05-08 Thread Abhishek Pratap
aah okie I think I was trying to get too clever. Guess that won't work ... Thanks, -Abhi On Fri, May 8, 2009 at 12:34 PM, Barney Boisvert bboisv...@gmail.comwrote: You'll have to iterate over your two lists of timestamps and build a set of ORed conditional pairs: sql = select ... from ...

Re: Help with mysql query, multiple list

2009-05-08 Thread Jim Lyons
why not something like below. Assume you have 3 pairs of start/end timestamps and you want to find everything within those 3 time periods: select * from table_name where start = start1 and end = end1 union select * from table_name where start = start2 and end = end2 union select * from

Re: Help with mysql query, multiple list

2009-05-08 Thread Abhishek Pratap
Hi Jim Unfortunately I have thousands of such points. So explicit statement calling will be very expensive both computationally and in terms of writing.. Thanks, -Abhi On Fri, May 8, 2009 at 12:37 PM, Jim Lyons jlyons4...@gmail.com wrote: why not something like below. Assume you have 3 pairs

Re: Help with mysql query, multiple list

2009-05-08 Thread Kyong Kim
Abhi, I might not be understanding the problem but could you use the max and min timestamp values and use something like SELECT * FROM TABLE WHERE start BETWEEN max AND min AND end BETWEEN max AND min or SELECT * FROM TABLE WHERE START IN (1,2,3,4,5) AND END IN(1,2,3,4,5) I might be

Re: Help with mysql query, multiple list

2009-05-08 Thread Jim Lyons
then either build the statement by way of a program like a perl script or select all records with a start time after the min start time of all in your list and an end time less than the max end time in your list then filter them further either in a program or a store procedure. On Fri, May 8,

Help with a query.

2009-01-27 Thread Micah Stevens
Hi, I'm somewhat stumped by how to set up a single query that does the following. Currently I'm accomplishing this through multiple queries and some PHP 'glue' logic, but it should be possible in a single query I think, and it's bugging me that I can't figure it out. If anyone has any ideas,

Re: Help with a query.

2009-01-27 Thread Peter Brawley
Micah, each item in `a` has a 1 to 1 relationship to `b`, and each item in `c` has a 1 to 1 relationship with `b`. Sometimes these correspond, i.e. there's a row in `b` that relates to both `a` and `c`, but not always. So in a given b row, the b_id value might match an a.a_id, a c.a_id, or

Re: Help with a query.

2009-01-27 Thread Micah Stevens
Peter Brawley wrote: Micah, each item in `a` has a 1 to 1 relationship to `b`, and each item in `c` has a 1 to 1 relationship with `b`. Sometimes these correspond, i.e. there's a row in `b` that relates to both `a` and `c`, but not always. So in a given b row, the b_id value might match an

Help with MySQL Query (2 Outer joins)

2008-01-23 Thread Raghuveer Rawat
Hi, I need some urgent for sql query.. It will be great if someone could help me.. I have ARTICLE, FAVORITE_ARTICLES, RATING Tables apart from other table USER, CHANNEL, CATEGORY etc ARTICLE table stores a user's article, FAVORITE_ARTICLES will store a user's favorite articles, and rating

Help with this query

2008-01-15 Thread Imran
Hi: I have a table that I need help to summarize the data. I need to be able to create one row of data for custno + prodno + period + weekno combination summarized by Invtot. Any help will be greatly appreciated. Best regards I am attaching the relevant info below: Sales

Re: Help with this query

2008-01-15 Thread Moon's Father
You can just use function sum to get what you want. On Jan 16, 2008 6:23 AM, Imran [EMAIL PROTECTED] wrote: Hi: I have a table that I need help to summarize the data. I need to be able to create one row of data for custno + prodno + period + weekno combination summarized by Invtot.

help with a query...

2007-12-28 Thread Richard
Hello, I'm trying to get what is for me quite a complicated query to work, if it's possible to do so anyway ... Here is my old query : SELECT a.message,a.date,b.surname,b.name,b.title FROM messages a JOIN info b ON a.from=b.code WHERE a.id='28' It worked fine untill I needed to have more than

Help with SQL query construction

2007-12-03 Thread Marcus Claesson
Hi! I have a SQL query construction question that I hope someone can help me with. After comparing a bunch of DNA fragments (see name below) with a larger reference sequence I get a ordered list ranked according to similarities, and with start/stop co-ordinates where the fragments map to the

RE: Help with SQL query construction

2007-12-03 Thread Jeff Mckeon
-Original Message- From: Marcus Claesson [mailto:[EMAIL PROTECTED] Sent: Monday, December 03, 2007 7:49 AM To: mysql@lists.mysql.com Subject: Help with SQL query construction Hi! I have a SQL query construction question that I hope someone can help me with. After comparing

Re: Help with SQL query construction

2007-12-03 Thread Peter Brawley
Marcus, I've managed to do this with a Perl-DBI script, but would much prefer to do it completely with MySQL instead. You could port it to a recursive stored procedure. It would probably be slower, and what would you have gained? PB Marcus Claesson wrote: Hi! I have a SQL query

Help with AVG query

2007-06-17 Thread Reynier Perez Mira
Hi every: I have this table: smp_evaluacion --- id_evaluacion eval1 eval2 eval3 eval4 eval5 This is for a rating system. I need to build a query for retrieve the best rating files. Normally with PHP I add every field, I mean (eval1, eval2, eval3, eval4, eval5) and

Re: Help with AVG query

2007-06-17 Thread Peter Brawley
Reynier, Normally with PHP I add every field, I mean (eval1, eval2, eval3, eval4, eval5) and then divide this result by 5, like a average. I know that SQL can do this directly using AVG function but I don't know how. Can any help me? AVG computes an average across rows. If I understand you

need help with delete query

2007-06-14 Thread Ben Liu
I'm trying to delete a subset of items in a table. The problem is, I don't want to query for the subset first, store the results and then run a series of delete queries. I believe this is a rather basic issue that has a well-accepted, simple solution which I am ignorant of. There are two relevant

Re: need help with delete query

2007-06-14 Thread Ben Liu
Thanks Brent, good tip. Works like a charm. On Jun 14, 2007, at 7:42 PM, Brent Baisley wrote: Here's a little trick. Get your DELETE query working as a SELECT. Then replace everything before FROM with DELETE tablename. SELECT order_items.ord_id FROM order_items LEFT JOIN orders ON

Re: need help with delete query

2007-06-14 Thread Reinhardt Christiansen
- Original Message - From: Ben Liu [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Thursday, June 14, 2007 3:11 PM Subject: need help with delete query I'm trying to delete a subset of items in a table. The problem is, I don't want to query for the subset first, store the results

Help indexing this query.

2007-01-22 Thread altendew
rows and is 75KB big. It runs extremely slow. I tried to create an index for it but it failed to increase performance. Any help is appreciated. -- View this message in context: http://www.nabble.com/Help-indexing-this-query.-tf3059045.html#a8505554 Sent from the MySQL - General mailing list

Re: Help indexing this query.

2007-01-22 Thread Dan Buettner
performance. Any help is appreciated. -- View this message in context: http://www.nabble.com/Help-indexing-this-query.-tf3059045.html#a8505554 Sent from the MySQL - General mailing list archive at Nabble.com. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql

Re: Help indexing this query.

2007-01-22 Thread altendew
. This `ptsSignups` table contains 82752 rows and is 75KB big. It runs extremely slow. I tried to create an index for it but it failed to increase performance. Any help is appreciated. -- View this message in context: http://www.nabble.com/Help-indexing-this-query.-tf3059045.html#a8505554 Sent

Re: Help indexing this query.

2007-01-22 Thread Dan Buettner
and is 75KB big. It runs extremely slow. I tried to create an index for it but it failed to increase performance. Any help is appreciated. -- View this message in context: http://www.nabble.com/Help-indexing-this-query.-tf3059045.html#a8505554 Sent from the MySQL - General mailing list archive

Re: Help indexing this query.

2007-01-22 Thread altendew
is appreciated. -- View this message in context: http://www.nabble.com/Help-indexing-this-query.-tf3059045.html#a8505554 Sent from the MySQL - General mailing list archive at Nabble.com. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http

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
with it). However, more indices = more overhead, which is sometimes a problem, sometimes not. Dan On 1/8/07, Michael Gargiullo [EMAIL PROTECTED] wrote: -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Sunday, January 07, 2007 1:12 PM To: mysql Subject: Help

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

RE: help with update query

2006-10-16 Thread Jerry Schwartz
Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 -Original Message- From: Ferindo Middleton [mailto:[EMAIL PROTECTED] Sent: Saturday, October 14, 2006 9:16 PM To: Dan Buettner Cc: mysql Subject: Re: help with update query Thanks Dan

Re: help with update query

2006-10-16 Thread Ferindo Middleton
Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 -Original Message- From: Ferindo Middleton [mailto:[EMAIL PROTECTED] Sent: Saturday, October 14, 2006 9:16 PM To: Dan Buettner Cc: mysql Subject: Re: help with update query Thanks Dan. This does

Re: help with update query

2006-10-14 Thread Dan Buettner
Ferindo, I had a similar task recently, and the problem you'll run into is that you can't select from and update the same table at once. What I ended up doing was doing a SELECT to build the update queries for me. Something like this: SELECT CONCAT( UPDATE bowler_score SET email_address = ',

Re: help with update query

2006-10-14 Thread Ferindo Middleton
Thanks Dan. This does help. This a pretty straight-forward idea. I could even save the results of this query to a text file and possibly review it a little before running it so I don't acidentally do anything funky and I could see the impact this would have on the data before applying it. I

Re: Re: help with update query

2006-10-14 Thread Dan Buettner
Good call on the WHERE email_address IS NULL thing. Also occurs to me you could do a SELECT DISTINCT instead of just a SELECT to eliminate duplicate update commands. Glad this was useful. Dan On 10/14/06, Ferindo Middleton [EMAIL PROTECTED] wrote: Thanks Dan. This does help. This a pretty

help with update query

2006-10-13 Thread Ferindo Middleton
I have a table, bowler_score_records, with the following columns: id, firstname, middlename, lastname, race, religion, email_address, bowling_score, gamedate As records get entered to this table, sometimes the users forget to input the email_address but the users always capture the full name,

help on join query

2006-06-26 Thread Nhadie
Hi All, Given this table: +-+-+++- |sip_status | sip_method | sip_callid | username | fromtag| totag

Re: please help optimize this query

2006-06-01 Thread Joseph Alotta
, 2006 12:25:50 PM CDT To: Joseph Alotta [EMAIL PROTECTED] Cc: mysql@lists.mysql.com Subject: Re: please help optimize this query I'd start by looking at your schema.. Quite a lot of use of varchars... I'd suggest using chars (takes more space but processes faster).. Or even better, normalize

please help optimize this query

2006-05-31 Thread Joseph Alotta
Greetings, I generate this report of all the holdings by symbol, summing up over accounts. It is taking much too long. I was wondering if I can add an index on something to make it more efficient. The first query gets the most recent date, the next query sums it up by symbol. Thank

Re: please help optimize this query

2006-05-31 Thread DreamWerx
I'd start by looking at your schema.. Quite a lot of use of varchars... I'd suggest using chars (takes more space but processes faster).. Or even better, normalize the data so that you have a table for symbols that is linked to this table via an integer based foreign key. Also it seems wierd

Help with this query. How to do a group by on a datetime just the month/day/year

2006-05-03 Thread Randy Paries
Hello, Not sure if i can do this. I have a table with a datetime column I would like to do group by a day of the month. if i do something like select count(*) from MTracking where mallarea=1001 group by timeofclick every one is listed because time. So is this possible? Thanks Randy --

RE: Help with this query. How to do a group by on a datetime just the month/day/year

2006-05-03 Thread George Law
try: group by substring(timeofclick,1,10) -Original Message- From: Randy Paries [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 11:25 AM To: mysql@lists.mysql.com Subject: Help with this query. How to do a group by on a datetime just the month/day/year Hello, Not sure if i

Re: Help with this query. How to do a group by on a datetime just the month/day/year

2006-05-03 Thread BJ Swope
select count(*), substring(timeofclick,1,7) from MTracking where mallarea=1001 group by 2; On 5/3/06, Randy Paries [EMAIL PROTECTED] wrote: Hello, Not sure if i can do this. I have a table with a datetime column I would like to do group by a day of the month. if i do something like

Need help with a query

2006-01-23 Thread Mark Phillips
I am running mysql 4.0.24 on Debian sarge. I have a table with two columns, team and division, both varchar(255). There are some errors in the table where division has a value but team is blank. Given that I am getting new data, and the data entry folks may create a record with a blank

Re: Need help with a query

2006-01-23 Thread Michael Stassen
Mark Phillips wrote: I am running mysql 4.0.24 on Debian sarge. I have a table with two columns, team and division, both varchar(255). There are some errors in the table where division has a value but team is blank. Given that I am getting new data, and the data entry folks may create a

Re: Need help with a query

2006-01-23 Thread Mark Phillips
On Monday 23 January 2006 03:33 pm, Michael Stassen wrote: Mark Phillips wrote: I am running mysql 4.0.24 on Debian sarge. I have a table with two columns, team and division, both varchar(255). There are some errors in the table where division has a value but team is blank. Given

Re: Need Help with a query

2005-12-12 Thread Gleb Paharenko
Hello. You may use these queries: select flight_id ,baseline*tan(radians(angle)) as attitude from flights where (baseline*tan(radians(angle))) = ( select max(baseline*tan(radians(angle))) from flights f2);

Need Help with a query

2005-12-11 Thread Mark Phillips
I have a table with several columns. The ones of interest are flight_id, angle, and baseline. I want to find the flight_ids for the flights with the maximum and minimum altitudes, where altitude=baseline*tan(radians(angle)). For example, Flights +++---+

Fw: Need Help with a query

2005-12-11 Thread Rhino
Oops, I meant to copy the list on this reply so that others could benefit Rhino - Original Message - From: Rhino [EMAIL PROTECTED] To: Mark Phillips [EMAIL PROTECTED] Sent: Sunday, December 11, 2005 6:19 PM Subject: Re: Need Help with a query - Original Message

Fwd: Re: Need Help with a query

2005-12-11 Thread Mark Phillips
I forgot to copy the list as well Mark -- Forwarded Message -- Subject: Re: Need Help with a query Date: Sunday 11 December 2005 06:47 pm From: Mark Phillips [EMAIL PROTECTED] To: Rhino [EMAIL PROTECTED] Rhino, My apologies for leaving out the version of mysql. I agree

Help with tricky query

2005-10-04 Thread Mike Blezien
Hello, I am trying to put together a single query from across 4 tables and not having a problem getting the results needed. table structure: ## CREATE TABLE IF NOT EXISTS job_posts ( jobid int(6) unsigned NOT NULL auto_increment,

Re: Help with tricky query

2005-10-04 Thread SGreen
Mike Blezien [EMAIL PROTECTED] wrote on 10/04/2005 08:34:56 AM: Hello, I am trying to put together a single query from across 4 tables and not having a problem getting the results needed. table structure: ## CREATE TABLE IF NOT EXISTS

Re: Help with tricky query

2005-10-04 Thread Mike Blezien
Hello, [EMAIL PROTECTED] wrote: Mike Blezien [EMAIL PROTECTED] wrote on 10/04/2005 08:34:56 AM: Hello, I am trying to put together a single query from across 4 tables and not having a problem getting the results needed. table structure:

Re: Help with tricky query

2005-10-04 Thread SGreen
Mike Blezien [EMAIL PROTECTED] wrote on 10/04/2005 10:08:24 AM: Hello, [EMAIL PROTECTED] wrote: Mike Blezien [EMAIL PROTECTED] wrote on 10/04/2005 08:34:56 AM: Hello, I am trying to put together a single query from across 4 tables and not having a problem getting the

Re: Help with tricky query

2005-10-04 Thread Mike Blezien
[EMAIL PROTECTED] wrote: Mike Blezien [EMAIL PROTECTED] wrote on 10/04/2005 10:08:24 AM: Hello, [EMAIL PROTECTED] wrote: Mike Blezien [EMAIL PROTECTED] wrote on 10/04/2005 08:34:56 AM: Hello, I am trying to put together a single query from across 4 tables and not having a

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

A little help with mysql's Query Cache configuration

2005-08-14 Thread Maxim Vexler
Mysql's query cache has two option's [query_cache_limit] and [query_cache_size]. The documentation is not clear (for me) on their purpose and correct usage tactics. What does the [query_cache_size] sets, the maximum memory space a single query can utilize ? Is it wise to set it to the same size

Re: A little help with mysql's Query Cache configuration

2005-08-14 Thread Alexey Polyakov
query_cache_size - a total size of memory that server utilizes for query caching. query_cache_limit - maximum size of result set that can be cached. I'd suggest leaving query_cache_limit at 1 mb (the default value), and tune query_cache_size until you have reasonably low qcache_lowmem_prunes

Re: help with slow query

2005-08-12 Thread SGreen
I know it's bad form to reply to yourself but I just found a major mental mistake in my response. See embedded: [EMAIL PROTECTED] wrote on 08/12/2005 12:18:21 AM: Sebastian [EMAIL PROTECTED] wrote on 08/11/2005 01:19:30 PM: well i managed to solve the problem myself, and im no sql

Re: help with slow query

2005-08-11 Thread Sebastian
no one has any info to help me out? all i need to know if there is a way to speed up the query or will i have to live with it. this query runs slow because AVG and COUNT on maps_rating table i think. can anything be done to improve? query: SELECT maps.*, AVG(maps_rating.rating) AS rating,

Re: help with slow query

2005-08-11 Thread Jigal van Hemert
Sebastian wrote: this query runs slow because AVG and COUNT on maps_rating table i think. can anything be done to improve? You may want to include: - table definitions (output of SHOW CREATE TABLE table) - output of EXPLAIN query This way the list members can make better suggestions.

Re: help with slow query

2005-08-11 Thread ManojW
a better chance of reply if you provide information on the above set of questions. Cheers Manoj - Original Message - From: Sebastian [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Thursday, August 11, 2005 3:52 PM Subject: Re: help with slow query no one has any info to help me out

Re: help with slow query

2005-08-11 Thread Gleb Paharenko
Hello. I've created tables similar to your and the query runs fast enough on my test data (maybe I have good indexes). Please, provide the EXPLAIN output for your query and exact definitions of your tables (use SHOW CREATE TABLE). Sebastian [EMAIL PROTECTED] wrote: this query runs

Re: help with slow query

2005-08-11 Thread Sebastian
Jigal van Hemert wrote: Sebastian wrote: this query runs slow because AVG and COUNT on maps_rating table i think. can anything be done to improve? You may want to include: - table definitions (output of SHOW CREATE TABLE table) - output of EXPLAIN query sorry for the lack of info. there

Re: help with slow query

2005-08-11 Thread Sebastian
well i managed to solve the problem myself, and im no sql genius... i thought i had an index on maps_rating.map which i didn't.. adding an index on it improved the query. i think that is about all the improvement i can get.. but if there is still room for more speed i'd like to know..

Re: help with slow query

2005-08-11 Thread Nuno Pereira
might help. Also making the query ALTER TABLE maps ORDER BY maps.dateline DESC once a day or more, would help the ordering. I may be saying too include much indexes (probably the first), but it may not make bad at all (probably updates/inserts would be slower). Making some tests might help to see

Re: help with slow query

2005-08-11 Thread Gleb Paharenko
Hello. i thought i had an index on maps_rating.map which i didn't.. adding an index on it improved the query. Have a look here: http://dev.mysql.com/doc/mysql/en/order-by-optimization.html http://dev.mysql.com/doc/mysql/en/group-by-optimization.html Sebastian [EMAIL

Re: help with slow query

2005-08-11 Thread SGreen
Sebastian [EMAIL PROTECTED] wrote on 08/11/2005 01:19:30 PM: well i managed to solve the problem myself, and im no sql genius... i thought i had an index on maps_rating.map which i didn't.. adding an index on it improved the query. i think that is about all the improvement i can get.. but

help with slow query

2005-08-10 Thread Sebastian
this query runs slow because AVG and COUNT on maps_rating table i think. can anything be done to improve? query: SELECT maps.*, AVG(maps_rating.rating) AS rating, COUNT(maps_rating.id) AS votes, user.username FROM maps LEFT JOIN maps_rating ON (maps.id = maps_rating.map) LEFT JOIN user ON

Need help with a query..

2005-06-16 Thread Cory Robin
I need to speed up a search, big time. I have an application that searches for records on a date field. If it doesn't find an exact date match, it keeps searching adjacent days until it finds a certain amount of records. The problem now is, I'm using my application to loop through and run

Re: Need help with a query..

2005-06-16 Thread Alec . Cawley
Cory Robin [EMAIL PROTECTED] wrote on 16/06/2005 08:09:22: I need to speed up a search, big time. I have an application that searches for records on a date field. If it doesn't find an exact date match, it keeps searching adjacent days until it finds a certain amount of records. The

Re: Need help with a query..

2005-06-16 Thread SGreen
[EMAIL PROTECTED] wrote on 06/16/2005 11:30:10 AM: Cory Robin [EMAIL PROTECTED] wrote on 16/06/2005 08:09:22: I need to speed up a search, big time. I have an application that searches for records on a date field. If it doesn't find an exact date match, it keeps searching adjacent

Re: Need help with a query..

2005-06-16 Thread Alec . Cawley
[EMAIL PROTECTED] wrote on 16/06/2005 16:29:46: [EMAIL PROTECTED] wrote on 06/16/2005 11:30:10 AM: Cory Robin [EMAIL PROTECTED] wrote on 16/06/2005 08:09:22: I need to speed up a search, big time. I have an application that searches for records on a date field. If it

Fw: Need help with a query..

2005-06-16 Thread SGreen
(forwarded to the list - I am not the OP) - Forwarded by Shawn Green/Unimin on 06/16/2005 11:45 AM - James Black [EMAIL PROTECTED] wrote on 06/16/2005 11:44:36 AM: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote on 06/16/2005 11:30:10

Re: Need help with a query..

2005-06-16 Thread Frank Bax
At 03:09 AM 6/16/05, Cory Robin wrote: I need to speed up a search, big time. I have an application that searches for records on a date field. If it doesn't find an exact date match, it keeps searching adjacent days until it finds a certain amount of records. The problem now is, I'm using my

Re: MySQL (SQL) Newbie.. Need help with a Query

2005-06-07 Thread mfatene
hi, that's the same. If you use between, mysql do the rest for you : mysql explain SELECT * FROM passengers WHERE - reservation_date_time = '2005-01-01 12:10:00' - AND reservation_date_time = '2005-05-01 12:10:00';

  1   2   3   >