RE: Need confirmation: Subselects are broken with regards to index usage?

2007-05-25 Thread Robert DiFalco
tuning and debugging. -Original Message- From: Baron Schwartz [mailto:[EMAIL PROTECTED] Sent: Thursday, May 24, 2007 2:35 PM To: Robert DiFalco Cc: mysql@lists.mysql.com Subject: Re: Need confirmation: Subselects are broken with regards to index usage? Hi Robert, The way non-correlated

Need confirmation: Subselects are broken with regards to index usage?

2007-05-24 Thread Robert DiFalco
I think I'm discovering that sub-selects in MySQL are broken. Is that true? It seems like you cannot have a sub-select without doing a table scan -- even for a constant IN expression -- this because it gets re-written as an EXISTS that executes for each row. Is that true? Forcing an index

RE: Need confirmation: Subselects are broken with regards to index usage?

2007-05-24 Thread Robert DiFalco
ON link.parentID=path.decendantId WHERE (path.ancestorId = 1) LIMIT 0,100; Anyone have any ideas why this is the case? -Original Message- From: Robert DiFalco [mailto:[EMAIL PROTECTED] Sent: Thursday, May 24, 2007 1:11 PM To: mysql@lists.mysql.com Subject: Need confirmation: Subselects

Re: Need confirmation: Subselects are broken with regards to index usage?

2007-05-24 Thread Baron Schwartz
? -Original Message- From: Robert DiFalco [mailto:[EMAIL PROTECTED] Sent: Thursday, May 24, 2007 1:11 PM To: mysql@lists.mysql.com Subject: Need confirmation: Subselects are broken with regards to index usage? I think I'm discovering that sub-selects in MySQL are broken. Is that true

When are subselects faster than Joins?

2006-11-06 Thread Robert DiFalco
Are there any hard and fast rules for this? If someone has already compiled a list I'd love to see it. For example: * When a subselect will eliminate duplicates a join might introduce. Change: SELECT DISTINCT Acl.* FROM Acl JOIN Link ON Link.childID = Acl.ID JOIN Paths ON

delete, where, and subselects...

2005-09-02 Thread Jason Pyeron
to quote the manual: Currently, you cannot delete from a table and select from the same table in a subquery. mysql select * from paths where id=(select max(ppathref) from paths); ++-++--+ | id | typeref | name | ppathref |

RE: delete, where, and subselects...

2005-09-02 Thread mfatene
2005 19:53 To: mysql@lists.mysql.com Subject: delete, where, and subselects... to quote the manual: Currently, you cannot delete from a table and select from the same table in a subquery. mysql select * from paths where id=(select max(ppathref) from paths

how can I do instead of using subselects?

2005-02-28 Thread Joppe A
Hello everyone, I have a problem with a few sql-queries because I have written the questions with subselect statements and then will they not work on older MySQL DB:s. Can any one help me to say haw to solve it without subselect! Today looks the questions like this: SELECT (SELECT

Fwd: how can I do instead of using subselects?

2005-02-28 Thread Joppe A
Please help, this must be easy for experinced MySQL users but for me as a newbie isn't it. I have tried to find the answer on the things below in older MySQL manuals but without any success... I have a problem with a few sql-queries because I have written the questions with subselect

Re: how can I do instead of using subselects?

2005-02-28 Thread Peter Brawley
Joppe, I have a problem with a few sql-queries because I have written the questions with subselect statements and then will they not work on older MySQL DB:s. Can any one help me to say haw to solve it without subselect! Today looks the questions like this: SELECT (SELECT count(SUB.S_ID)

Re: Fwd: how can I do instead of using subselects?

2005-02-28 Thread Peter Brawley
Joppe, Another question is how do I do when I want to compare two tables, normally is it no problem to get a list with rows that exist i both tables, but how do I do if I want to to have the diffrence listed instead, the rows that only appears in one of the tables? SELECT * FROM tblA LEFT JOIN

RE: help to structure query without using subselects

2003-08-01 Thread Petre Agenbag
subselects * Petre Agenbag [...] This works: select distinct name, max(id) as mid from table group by name but it only returns the name and the highest id for such a name. if I try this: select distinct name, max(id) as mid, anything_else from table group by name it returns the FIRST

Re: help to structure query without using subselects

2003-08-01 Thread Roger Baklund
* Petre Agenbag The distinct clause will return only one occurrance of the implicated field. distinctrow would do the same, but for an entire row. what I am looking for is something like distinctset(field1,field2,field7) , is this what the MAX-CONCAT trick attempts to do? Not exactly, but

help to structure query without using subselects

2003-07-31 Thread Petre Agenbag
Hi List Can anyone help me to do the following without the need of subselects: I have a table that contains rows where mostly, the only common field is the name. The rest of the data fields, even though they are related to the name, differs from row to row ( they are things like the address etc

Re: help to structure query without using subselects

2003-07-31 Thread Roger Baklund
* Petre Agenbag [...] This works: select distinct name, max(id) as mid from table group by name but it only returns the name and the highest id for such a name. if I try this: select distinct name, max(id) as mid, anything_else from table group by name it returns the FIRST

subselects or join?

2003-07-29 Thread Petre Agenbag
Hi List, My head is not on right today. I have something like this: main_table id namemain_type 1 joe type1 2 johntype2 3 jacktype1 table type1 id_type1id action 1 1 2003-07-01 2 1 2003-08-03 3

subselects in 4.1 and indexes

2003-06-09 Thread Christopher Knight
Im have a problem / misunderstanding with the 4.1 release. Im having issues with indexes related to 'IN' vs '=' in subselects. assume the subselect returns 1 value select SQL_NO_CACHE user_id from table_a where user_id in (select SQL_NO_CACHE user_id from table_b where ... blah) 9.5 seconds

Re: subselects in 4.1 and indexes

2003-06-09 Thread Jeremy Zawodny
On Mon, Jun 09, 2003 at 12:46:32PM -0500, Christopher Knight wrote: Im have a problem / misunderstanding with the 4.1 release. Im having issues with indexes related to 'IN' vs '=' in subselects. assume the subselect returns 1 value select SQL_NO_CACHE user_id from table_a where user_id

Re: working around lack of subselects

2003-02-09 Thread Andy Smith
On Thu, Feb 06, 2003 at 09:52:11AM -0500, Brent Baisley wrote: As long as the foreign keys are index it should be pretty quick. There really is no way to get around processing every record in table data. As that table grows, your query will get slower. But a 157K rows isn't really a whole

Re: working around lack of subselects

2003-02-07 Thread Brent Baisley
As long as the foreign keys are index it should be pretty quick. There really is no way to get around processing every record in table data. As that table grows, your query will get slower. But a 157K rows isn't really a whole lot. How long does it take? Obviously you would want to run SELECT

working around lack of subselects

2003-02-06 Thread Andy Smith
Hi folks, I have a problem that normally I'd want to use subselects on. Here it goes: Table t1 has a column data_id. Table t2 has a column data_id. Both are foreign keys for the autoincrement primary column id of the table called data. I wish to delete every row from data which

subselects

2003-01-02 Thread Ahmed Farouk
Hi All I know that this maybe a repeated question here but I just need to know the updates. I am asking about the new feature of subselects which should be implemented in version 4.1 (thats what i know), when this version is expected to the light ? For me this single feature (subselect

Re: subselects

2003-01-02 Thread greg55
How's your application written? i.e. J2EE? We've managed to put a layer in between the application and MySql that translates subselects on the fly into inner joins. This allowed us to quite painlessly move from MS SQL to MySql. EXISTS can be refactored into an inner join. NOT EXISTS can

Re: subselects

2003-01-02 Thread Ahmed Farouk
Thanks Greg for the hint but I also wanted to know when is MySQL version 4.1 to be expected to show up in binaries ? Ahmed - Original Message - From: [EMAIL PROTECTED] To: Ahmed Farouk [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 02, 2003 11:46 PM Subject: Re: subselects

Re: subselects

2003-01-02 Thread Heikki Tuuri
Ahmed, - Original Message - From: Ahmed Farouk [EMAIL PROTECTED] Newsgroups: mailing.database.mysql Sent: Thursday, January 02, 2003 9:52 PM Subject: subselects Hi All I know that this maybe a repeated question here but I just need to know the updates. I am asking about the new

getting around lack of subselects in mysql 3.23.*

2002-08-21 Thread Gabriel J Zimmerman
I need to figure out values in a column of a given table that do not exist in a a column of another given table without subselects. For example: If I have one table called TABLEA with column name id and values 1,2,3,4,5,6,7, and another table called TABLEB with column name id and values

Re: getting around lack of subselects in mysql 3.23.*

2002-08-21 Thread Benjamin Pflugmann
Hello. On Wed 2002-08-21 at 16:49:06 -0400, [EMAIL PROTECTED] wrote: I need to figure out values in a column of a given table that do not exist in a a column of another given table without subselects. For example: If I have one table called TABLEA with column name id and values

Re: getting around lack of subselects in mysql 3.23.*

2002-08-21 Thread Gabriel J Zimmerman
of another given table without subselects. For example: If I have one table called TABLEA with column name id and values 1,2,3,4,5,6,7, and another table called TABLEB with column name id and values 3,4,5. Is there any select statement I can do, which will return records in TABLEA with id values

Re: MySQL: Temporary Tables / Subselects

2002-06-20 Thread Galen Wright-Watson
On Thu, 20 Jun 2002, Seth Yount wrote: Hello experts I'm glad you think so highly of us. I am trying to decide which would be the most efficient way of retrieving data, Subselects (nested queries?) or Temporary Tables? Does MySQL even support these yet? MySQL supports temporary

subselects in mysql 4.1 and other questions

2002-06-03 Thread Alexander Belyaev
Hi, 1. I am reading 'internals' list and I see some words about subselect in 'bk commit into 4.1 tree' messages... Seems like we can expect subselect in 4.1 branch !?? :) 2. When 4.0.2 beta will be released? 3. Seems like gcc 3.0 (or 3.1?) becomes an official recommended compliler for mysql

Re: subselects in mysql 4.1 and other questions

2002-06-03 Thread Egor Egorov
Alexander, Monday, June 03, 2002, 9:46:40 AM, you wrote: AB 1. I am reading 'internals' list and I see some words about subselect in 'bk AB commit into 4.1 tree' messages... AB Seems like we can expect subselect in 4.1 branch !?? :) Yeah, sub-selects is in our TODO for 4.1, look at:

Re: Subselects

2001-10-04 Thread Benjamin Pflugmann
Hi. On Tue, Oct 02, 2001 at 04:44:08PM +0100, [EMAIL PROTECTED] wrote: [...] I would like to use Subselects with mySQL but they are not supported until 3.24. Sub-selects are scheduled for 4.1, as far as I know (also see end of page http://www.mysql.com/doc/M/y/MySQL-PostgreSQL_features.html

Subselects

2001-10-02 Thread John Seers
(Apologies in advance if this is the wrong place to ask, but this is my first foray into this list.) I would like to use Subselects with mySQL but they are not supported until 3.24. Can anyone tell me if there is an estimated date for the release of 3.24? Secondly is it likely

RE: Subselects

2001-10-02 Thread Daniel Ouellet
To: [EMAIL PROTECTED] Subject: Subselects (Apologies in advance if this is the wrong place to ask, but this is my first foray into this list.) I would like to use Subselects with mySQL but they are not supported until 3.24. Can anyone tell me if there is an estimated date for the release