Re: Query Problems

2007-07-19 Thread Douglas Araujo
We solved it here, There was a problem in the query, we removed the "t1" at the 'group by' section. The problem was really a sintax error in the code not in the server. Thanks, Douglas 2007/7/19, Michael Dykman <[EMAIL PROTECTED]>: instead of leaving it in PHP, please print out your fully fo

Re: Query Problems

2004-02-26 Thread Eric Scuccimarra
For anyone who is interested the thing that worked and brought the query down from 8 minutes to 5 seconds was separating out the JOIN to remove the OR. I made it into two queries and UNIONed them together and it all works beautifully now. Thanks. At 02:33 PM 2/25/2004 -0800, Daniel Clark wrote

Re: Query Problems

2004-02-26 Thread Eric Scuccimarra
Have one more question - indexing the relevant columns based on the explain info has made all of our queries immensely faster. But it appears that new rows are not automatically indexed. Does anyone know about this and if they are not indexed how do I reindex the tables? Thanks. -- MySQL Gen

Re: Query Problems

2004-02-26 Thread Keith C. Ivey
On 26 Feb 2004 at 13:22, Eric Scuccimarra wrote: > But it appears that new rows are not automatically indexed. Does > anyone know about this and if they are not indexed how do I reindex > the tables? You're misunderstanding something. When you create an index, all the rows in the table are inde

Re: Query Problems

2004-02-26 Thread Sasha Pachev
Eric Scuccimarra wrote: Have one more question - indexing the relevant columns based on the explain info has made all of our queries immensely faster. But it appears that new rows are not automatically indexed. Does anyone know about this and if they are not indexed how do I reindex the tables?

Re: Query Problems

2004-02-25 Thread Eric Scuccimarra
Tried to make the indexes separate and did an EXPLAIN and no performance increase and this is what the explain says: id select_type table typepossible_keys key key_len ref rowsExtra 1 SIMPLE tb ALL PRIMARY,tb_ndx3,tb_ndx4,tb_ndx5 NULLNU

Re: Query Problems

2004-02-25 Thread Daniel Clark
I know Oracle likes the indexes separatly, but mySQL might like combinations. > No, we tried individual indexes and then one big grouped index but not > individual indexes on each of the fields. Adding the index actually > added a few seconds to the query so we weren't sure if that was the way >

Re: Query Problems

2004-02-25 Thread Eric Scuccimarra
No, we tried individual indexes and then one big grouped index but not individual indexes on each of the fields. Adding the index actually added a few seconds to the query so we weren't sure if that was the way to go. I'll try this, though. Eric At 10:36 AM 2/25/2004 -0800, Daniel Clark wrote:

Re: Query Problems

2004-02-25 Thread Keith C. Ivey
On 25 Feb 2004 at 13:09, Eric Scuccimarra wrote: > Select* > FROM Table1 as a > INNER JOIN Table2 as b ON (a.ID = b.ID or (a.Field1 = b.Field1 and > a.Field2 = b.Field2)) WHERE bla bla bla It's hard to know without seeing the indexes and the full WHERE clause, but part of th

Re: Query Problems

2004-02-25 Thread Daniel Clark
Do you have separate indexes on: Table1.ID Table2.ID Table1.Field1 Table2.Field1 Table1.Field1 Table1.Field2 > Select* > FROM Table1 as a > INNER JOIN Table2 as b ON (a.ID = b.ID or (a.Field1 = b.Field1 and > a.Field2 = b.Field2)) > WHERE bla bla bla > > We ha

RE: Query Problems

2004-02-25 Thread David Perron
What does the explain look like? -Original Message- From: Eric Scuccimarra [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 25, 2004 1:03 PM To: [EMAIL PROTECTED] Subject: Query Problems I am doing a very simple query joining two copies of tables with identical structures but differ

Re: Query problems

2001-04-23 Thread Gerald Clark
Use merge tables, or two separate queries. "Wix,Christian XCW" wrote: > > Hi > I have two similar tables. (table1 & table2). They contain the columns > "name", "distance" and "date". Table1 is year 2000 and Table2 year 2001. > > I need to get the total distance for each name. > For year 2000 I

RE: Query problems

2001-04-23 Thread Warren van der Merwe
Hi In my opinion I would imagine Merged tables would do what you wanting. Refer to the MYSQL manual. Thanks ~ Warren van der Merwe Software Director PRT Trading (Pty) Ltd t/a RedTie Cell (083) 262-9163 Office (031) 767-0249 > -Original Message- > From:

Re: Query problems

2001-04-23 Thread meyer
Create a merge table of the year 2000 and year 2001 tables as follows. Then run your select on the merged table. You can then drop the merge table if you don't need it anymore. CREATE TABLE table3 (name, distance, date) TYPE=MERGE UNION=(table1,table2); SELECT name, SUM(distance) FROM table3 GR