Re: A Simple Query Help

2012-04-22 Thread Igor Shevtsov
Hi Rafael, You can try using correlated subquery instead of outer join. This can be slow with big tables though: SELECT * FROM users WHERE accept_email = 1 and email not in (SELECT email FROM sent_emails WHERE sent_emails .email = users.email AND messageID NOT LIKE = ‘XX’) OR OUTER JOIN as

A Simple Query Help

2012-04-22 Thread Rafael Ribeiro
Dear Friends, I m new on this list, and I m trying to learn more about mysql. After perform a lot of searchs in the Internet, I have no answer to my question and would like to ask your help. I wanna a perform a query that depends of the result from another (query) table inside the same

Fw: Simple Query Question

2012-04-14 Thread Abhishek Choudhary
ossamt; Thanks , abhisehk choudhary www.tech4urhelp.blogspot.com From: Stefan Kuhn To: mysql@lists.mysql.com Sent: Saturday, 14 April 2012 4:51 PM Subject: Re: Simple Query Question On Saturday 14 April 2012 09:51:11 Willy Mularto wrote: > Hi, > Please help w

Re: Simple Query Question

2012-04-14 Thread Willy Mularto
Hi many thanks for the help :) On Apr 14, 2012, at 6:21 PM, Stefan Kuhn wrote: > On Saturday 14 April 2012 09:51:11 Willy Mularto wrote: >> Hi, >> Please help what is wrong with this simple query "SELECT COUNT(key_agent) >> total FROM agents_consolidated WHERE total

Re: Simple Query Question

2012-04-14 Thread Stefan Kuhn
On Saturday 14 April 2012 09:51:11 Willy Mularto wrote: > Hi, > Please help what is wrong with this simple query "SELECT COUNT(key_agent) > total FROM agents_consolidated WHERE total = 180" Thanks. You need to use having instead of where, see the documentation. Stefan &g

Simple Query Question

2012-04-14 Thread Willy Mularto
Hi, Please help what is wrong with this simple query "SELECT COUNT(key_agent) total FROM agents_consolidated WHERE total = 180" Thanks. Willy Mularto F300HD+MR18DE (NLC1725)

Re: Need Help Writing Simple Query

2010-07-26 Thread Mark Phillips
t 1) as name_2 > from test1; > > - test1 table: > col1v_idh_id > America 1 2 > > - test2 table: > id name > 2 SAM > 1 UNCLE > > - Original Message - > From: "Mark Phillips" > To: "Mysql List" >

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 t

Re: Need Help Writing Simple Query

2010-07-25 Thread Nguyen Manh Cuong
SAM 1 UNCLE - Original Message - From: "Mark Phillips" To: "Mysql List" 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 a simple query for two

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

Re: Simple query takes forever

2009-12-31 Thread mos
At 08:25 AM 12/31/2009, you wrote: OK, this problem (for me at least) is becoming a dead horse which I beat daily. I was having problems, I thought, with a spatial query running ridiculously slowly. Turns out the previous non-spatial index query I was using is also running super slow for reason

Re: Simple query takes forever

2009-12-31 Thread René Fournier
Here's the table definition, in case that helps: | qs| CREATE TABLE `qs` ( `id` mediumint(8) unsigned NOT NULL auto_increment, `province` enum('BC','AB','SK','MB') collate latin1_general_ci NOT NULL, `s_ts_r_m` varchar(15) collate latin1_general_ci NOT NULL, `quartersection` varchar(3)

Simple query takes forever

2009-12-31 Thread René Fournier
OK, this problem (for me at least) is becoming a dead horse which I beat daily. I was having problems, I thought, with a spatial query running ridiculously slowly. Turns out the previous non-spatial index query I was using is also running super slow for reasons I can't figure out. So, to recap:

Re: Simple Query Question

2009-12-17 Thread Ian
Hi, Thanks, I just checked and it was a memcache that was caching the output. See I knew it was a simple solution ;) Thanks for the effort everyone and sorry for wasting time. Regards Ian 2009/12/17 Aleksandar Bradaric > Hi Ian, > > Why do you think something's wrong? Here is my test data and

Re: Simple Query Question

2009-12-17 Thread Aleksandar Bradaric
Hi Ian, Why do you think something's wrong? Here is my test data and the results of your query: --- mysql> SELECT * FROM wp_views; +-+-++---+ | blog_id | post_id | date | views | +-+-++---+ | 1 | 1 | 2009-12-16 |

Simple Query Question

2009-12-17 Thread Ian
Hi, I am sure there is a simple solution to this problem, I just cant find it :) I have got a table that records views for an article for each blog per day. So the structure is as follows: CREATE TABLE `wp_views` ( `blog_id` int(11) NOT NULL, `post_id` int(11) NOT NULL, `date` date NOT NULL, `vi

Re: Simple query slow on large table

2009-08-18 Thread Perrin Harkins
On Tue, Aug 18, 2009 at 5:08 AM, Simon Kimber wrote: > I have indexes on siteid, datestamp and msgtype. > > Queries such as the following are constantly appearing in the slow > queries log: > > SELECT * FROM enquiries WHERE siteid = 59255 AND msgtype = 0 ORDER BY > datestamp DESC LIMIT 5; Read the

Re: Simple query slow on large table

2009-08-18 Thread walter harms
Simon Kimber schrieb: > Hi Everyone, > > I'm having a very simple query often take several seconds to run and > would be hugely grateful for any advice on how i might spped this up. > > The table contains around 500k rows and the

Simple query slow on large table

2009-08-18 Thread Simon Kimber
Hi Everyone, I'm having a very simple query often take several seconds to run and would be hugely grateful for any advice on how i might spped this up. The table contains around 500k rows and the structure is as fo

Re: Why is simple query not using index?

2009-03-04 Thread David Karr
On Tue, Mar 3, 2009 at 6:51 PM, Perrin Harkins wrote: > My guess would be that your table is too small to bother using an > index on. There's some information in the MySQL docs about when it > chooses to use an index. For small tables, using one makes the query > slower. I think this is likel

Re: Why is simple query not using index?

2009-03-03 Thread Perrin Harkins
My guess would be that your table is too small to bother using an index on. There's some information in the MySQL docs about when it chooses to use an index. For small tables, using one makes the query slower. - Perrin On Tue, Mar 3, 2009 at 7:58 PM, David Karr wrote: > I'm using MySQL 5.0.67-

Why is simple query not using index?

2009-03-03 Thread David Karr
I'm using MySQL 5.0.67-0ubuntu6. I'm stepping through "MySQL - 4th Edition". There's a simple table called "member" that we've just added an index to, for the "expiration" column, which is a date column. The current example in the book is: mysql> EXPLAIN SELECT * FROM MEMBER > -> WHERE expir

Re: Simple data, simple query giving me a brain-ache

2009-02-15 Thread michael
) { > print $row->{first_name}; > print $row->{last_name}; > } > > then you could use select * from table_name without any problem. > > Octavian > > ----- Original Message - > From: > To: "MySQL General List" > Sent: Saturday, February 14, 2009 3

Re: Simple data, simple query giving me a brain-ache

2009-02-13 Thread michael
I'm a SQL novice, and I'v been looking at this, and I know I shouldn't, but I was 'Thinking'; Why wouldn't you do the following? SELECT * from HowToExample ORDER BY Ranking; Just curious, Michael. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

Re: Simple data, simple query giving me a brain-ache

2009-02-13 Thread Baron Schwartz
Timothy, On Fri, Feb 13, 2009 at 4:45 PM, Little, Timothy wrote: > Ok, I have a select statement which must return the distinct names, > sorted by ranking (lowest to highest). > > Seems absurdly simple, right, and I'm sure it would be... look at this > example > > CREATE TABLE IF NOT EXISTS HowTo

Simple data, simple query giving me a brain-ache

2009-02-13 Thread Little, Timothy
Ok, I have a select statement which must return the distinct names, sorted by ranking (lowest to highest). Seems absurdly simple, right, and I'm sure it would be... look at this example CREATE TABLE IF NOT EXISTS HowToExample ( Name VARCHAR( 32 ), Ranking INTEGER ) ENGINE=MyISAM; IN

Re: Simple Query

2007-11-12 Thread Peter Brawley
t is probably a rather simple query. I have two tables. The first contains several columns, but most importantly an id column. The second is has two columns, an id that corresponds with the id in the first table, and a value. For every row in the first table I'd like to insert a

Simple Query

2007-11-12 Thread Ben Wiechman
I need help writing what is probably a rather simple query. I have two tables. The first contains several columns, but most importantly an id column. The second is has two columns, an id that corresponds with the id in the first table, and a value. For every row in the first table I&#

Re: Index usage for simple query

2007-10-25 Thread Baron Schwartz
Hi, Joerg Bruehe wrote: Hi all, Baron Schwartz wrote: Hi, Colin Martin wrote: Baron Schwartz wrote: Hi, Colin Martin wrote: Hi there, Can someone please explain why when the query below uses one constant in the WHERE clause, MySQL decides to use the index on the 'source' column, and w

Re: Index usage for simple query

2007-10-25 Thread Joerg Bruehe
Hi all, Baron Schwartz wrote: Hi, Colin Martin wrote: Baron Schwartz wrote: Hi, Colin Martin wrote: Hi there, Can someone please explain why when the query below uses one constant in the WHERE clause, MySQL decides to use the index on the 'source' column, and why in the second query whe

Re: Index usage for simple query

2007-10-25 Thread Baron Schwartz
Hi, Colin Martin wrote: Baron Schwartz wrote: Hi, Colin Martin wrote: Hi there, Can someone please explain why when the query below uses one constant in the WHERE clause, MySQL decides to use the index on the 'source' column, and why in the second query where there are two constants, it d

Re: Index usage for simple query

2007-10-25 Thread Colin Martin
Baron Schwartz wrote: Hi, Colin Martin wrote: Hi there, Can someone please explain why when the query below uses one constant in the WHERE clause, MySQL decides to use the index on the 'source' column, and why in the second query where there are two constants, it decides not to? Is there

Re: Index usage for simple query

2007-10-25 Thread Baron Schwartz
Hi, Colin Martin wrote: Hi there, Can someone please explain why when the query below uses one constant in the WHERE clause, MySQL decides to use the index on the 'source' column, and why in the second query where there are two constants, it decides not to? Is there a way to get MySQL to u

Index usage for simple query

2007-10-25 Thread Colin Martin
Hi there, Can someone please explain why when the query below uses one constant in the WHERE clause, MySQL decides to use the index on the 'source' column, and why in the second query where there are two constants, it decides not to? Is there a way to get MySQL to use the index for the secon

Re: What should be a simple query...

2007-09-11 Thread David Schneider-Joseph
Try this: SELECT RMAs.rma_id FROM RMAs, rma_line_items WHERE TO_DAYS(date_settled) = 733274 AND RMAs.rma_id = rma_line_items.rma_id GROUP BY RMAs.rma_id HAVING COUNT(*) > 1 On Sep 10, 2007, at 11:36 PM, Mike Mannakee wrote: I have two tables, one called RMAs and the other called rma_line_item

What should be a simple query...

2007-09-10 Thread Mike Mannakee
I have two tables, one called RMAs and the other called rma_line_items. The first one has the general details of the RMA (Return Merchandise Authorization) , the second holds the details of each item being returned. What I want is a listing of the RMA ids (which are unique in the RMAs table) w

how to optimize this simple query with join?

2007-03-03 Thread MAS!
I have to tables (on mysql 5.0.22): Table: shelf CREATE TABLE `shelf` ( `isbn` varchar(10) NOT NULL default '', `product_type` char(1) default NULL, `title` varchar(150) NOT NULL default '', (...) PRIMARY KEY (`isbn`), KEY `publ_date` (`publ_date`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1

Re: Having problems with what appears to be a simple query.

2007-01-17 Thread Daniel Smith
On Wed, 2007-01-17 at 11:47 -0600, Peter Brawley wrote: > Daniel, > > CREATE TABLE tbl ( > lab_number int(11) default NULL, > result int(11) default NULL, > release_time datetime default NULL > ); > select * from tbl; > +++-+ > | lab_number | result |

Re: Having problems with what appears to be a simple query.

2007-01-17 Thread Peter Brawley
Daniel, CREATE TABLE tbl ( lab_number int(11) default NULL, result int(11) default NULL, release_time datetime default NULL ); select * from tbl; +++-+ | lab_number | result | release_time| +++-+ |

Re: Having problems with what appears to be a simple query.

2007-01-17 Thread Daniel Smith
On Wed, 2007-01-17 at 09:56 -0600, Peter Brawley wrote: > Daniel, > > >find the lab_number where ALL the tests have been performed and > >not the lab_numbers which have partial results. > > SELECT t1.lab,t1.res,t1.dt > FROM tbl t1 > WHERE NOT EXISTS( > SELECT lab FROM tbl t2 WHERE t1.lab=t2.lab

Re: Having problems with what appears to be a simple query.

2007-01-17 Thread Peter Brawley
Daniel, find the lab_number where ALL the tests have been performed and not the lab_numbers which have partial results. SELECT t1.lab,t1.res,t1.dt FROM tbl t1 WHERE NOT EXISTS( SELECT lab FROM tbl t2 WHERE t1.lab=t2.lab AND t2.res IS NULL ); The decorrelated version uses an exclusion join, r

Having problems with what appears to be a simple query.

2007-01-17 Thread Daniel Smith
I have a table with numerous columns but needing to perform a query based on three columns: Lab_number, result, release_time. What I want to do is search for lab_number where there is a result but not released. The problem that is making this difficult for me, is that there are multiple entries

RE: Help regarding a simple query

2006-03-13 Thread Jeff
>-Original Message- >From: VenuGopal Papasani [mailto:[EMAIL PROTECTED] >Sent: Monday, March 13, 2006 11:48 >To: Jeff >Subject: Re: Help regarding a simple query > > >Hi Jeff, > This is venu again.Last mail i did not include a constraint that is what irritatin

Re: Help regarding a simple query

2006-03-13 Thread Peter Brawley
Now i need to get all the records which consists of the string venu(case should not be considered either case should be).i.e i should get 1,2,3,4,5,8 records A simple way is ...  ...   WHERE LOCATE('venu', col_name ) > 0   ... or if the column is [VAR]BINARY, LOCATE('venu',CAST(col_name

RE: Help regarding a simple query

2006-03-13 Thread Jeff
> -Original Message- > From: VenuGopal Papasani [mailto:[EMAIL PROTECTED] > Sent: Monday, March 13, 2006 10:33 > To: mysql@lists.mysql.com > Subject: Help regarding a simple query > > > Hi, > I am searching for a query where i can have pattern > ma

Help regarding a simple query

2006-03-13 Thread VenuGopal Papasani
Hi, I am searching for a query where i can have pattern matching without considering the cases.You can consider the following example for detailed description of what i want exactly. Let my table X consists of following data Name --- venu venup venugopla VenugOpal VENU pap

Re: simple query

2006-03-13 Thread Diego Ignacio Wald
Hope this helps: select min(ctime), max(ctime) from tbl_a where ctime != "-00-00 00:00:00" Best regards, Diego - Original Message - From: "Xiaobo Chen" <[EMAIL PROTECTED]> To: Sent: Monday, March 13, 2006 11:17 AM Subject: simple query Hi, all

simple query

2006-03-13 Thread Xiaobo Chen
Hi, all I have a table which has a column with "time". It's format is like "-00-00 00:00:00" (default value). I want to get the minimum and maximum values for this cloumn. Obviously, "-00-00 00:00:00" isn't the minimum value I want. What I did for the "minimum" time, suppose the column na

Re: Unclear on UPDATE versus INSERT, and a simple query that is not working

2005-09-15 Thread Dave
UPDATE forums_members,members SET forums_members.active=members.active WHERE forums_members.member_id = members.id Oh, I see. I now feel a little foolish as I should have grasped that. For some reason I assumed that by specifying where to get the data from, it would be assumed that's what t

Re: Unclear on UPDATE versus INSERT, and a simple query that is not working

2005-09-15 Thread Pooly
2005/9/15, Dave <[EMAIL PROTECTED]>: > MySQL General List, > > Server specifications: > MySQL 4.1.3-beta, phpMyAdmin 2.5.7-pl1, PHP 4.3.8 > My specifications: > MySQL beginner, PHP intermediate, HTML and CSS advanced. > > The situation: > I have two tables, one old, and one new. In bo

Unclear on UPDATE versus INSERT, and a simple query that is not working

2005-09-15 Thread Dave
MySQL General List, Server specifications: MySQL 4.1.3-beta, phpMyAdmin 2.5.7-pl1, PHP 4.3.8 My specifications: MySQL beginner, PHP intermediate, HTML and CSS advanced. The situation: I have two tables, one old, and one new. In both tables I have a column called "active", which is either

Re: simple query on an indexed col in big table is extremely slow

2005-07-28 Thread Zhe Wang
| 512 | +--+--+ Regards, Zhe [EMAIL PROTECTED] wrote: Zhe Wang <[EMAIL PROTECTED]> wrote on 07/28/2005 10:40:08 AM: Hi, there, I am have a hard time figuring out why a simple query is extremely slow. I would greatly appreciate if yo

Re: simple query on an indexed col in big table is extremely slow

2005-07-28 Thread SGreen
Zhe Wang <[EMAIL PROTECTED]> wrote on 07/28/2005 10:40:08 AM: > Hi, there, > > I am have a hard time figuring out why a simple query is extremely > slow. I would greatly appreciate if you can shed some light! > > The table is in InnoDB: > > CREATE T

simple query on an indexed col in big table is extremely slow

2005-07-28 Thread Zhe Wang
Hi, there, I am have a hard time figuring out why a simple query is extremely slow. I would greatly appreciate if you can shed some light! The table is in InnoDB: CREATE TABLE `rps_hits` ( `gi` int(10) unsigned NOT NULL default '0', `cddid` int(10) unsigned NOT NULL

Re[3]: Simple query? Is it possible? (hm.. solution?, maybe can be better?)

2005-05-09 Thread Vaidas Zilionis
Hello Vaidas, Monday, May 9, 2005, 3:08:26 PM, you wrote: hm founded something intresting :) set @mynr:=0; Select @mynr as nr,table.id from table where @a:=IF((table.id=0),0,(@a+1)) having table.id=518 order by id strange IF hack :) main problem what this metod not fast. tested in table with 35

Re[2]: Simple query? Is it possible?

2005-05-09 Thread Vaidas Zilionis
Hello Roger, Monday, May 9, 2005, 2:56:18 PM, you wrote: Heh if i know page i would haven't problem. but i need to get also correct page with link doomain.con/items.php?showid=45 it can be anywhere! :) I making web application with data binding (IE stuff) data is loading very fast, can be 10

Re: Simple query? Is it possible?

2005-05-09 Thread Roger Baklund
Vaidas Zilionis wrote: [...] Example items are displayed 100 in page, and i display 20 pages numbers 1 ... 4[5] 6 x doomain.con/items.php?page=5 and i get all result here with limit 400,100 Yes, with PHP it would be something like this: $items_per_page = 100; $limit_clause = ((int)$page-1)*$ite

Simple query? Is it possible?

2005-05-09 Thread Vaidas Zilionis
Hi all, let's figure we have one big database table ~1mln rows. I can easly to collect needed data from this table with query: SELECT id,title,cdate FROM bigtable WHERE active ORDER BY cdate ASC, id ASC LIMIT 300,100 So i get needed rows to display. i can make easly with page numbers to display

Re: Why is this simple query so slow?

2004-12-10 Thread Dan Nelson
In the last episode (Dec 10), Aaron said: > The query below takes around 8 seconds, and returns 3253 rows. > > Query:SELECT ID FROM Offers_To_Buy FORCE INDEX(scdd) WHERE subcatID = 72; > 3253 rows in set (8.00 sec) > > Explain says: Bad word-wrapping fixed: > mysql> EXPLAIN SELECT ID FROM Of

RE: Why is this simple query so slow?

2004-12-10 Thread Donny Simonton
3. Why so many indexes? Do you search on every one of those fields? If not, then you are probably wasting diskspace and speed. Donny > -Original Message- > From: Aaron [mailto:[EMAIL PROTECTED] > Sent: Friday, December 10, 2004 8:12 PM > To: [EMAIL PROTECTED] > Subject: Wh

Re: Why is this simple query so slow?

2004-12-10 Thread Victor Pendleton
Have you tried optimizing or run an analyze table command on this table? Aaron wrote: Hi all , I have a relatively simple query that is taking longer than I think it should. Can anyone possibly give me some idea why this might be or any potential bottleneck areas I might want to check out

Why is this simple query so slow?

2004-12-10 Thread Aaron
Hi all , I have a relatively simple query that is taking longer than I think it should. Can anyone possibly give me some idea why this might be or any potential bottleneck areas I might want to check out? thanks! Here is some information. The query below takes around 8 seconds, and

Re: Simple query question

2004-09-20 Thread Roger Baklund
* John Mistler > I have a table in which the first column is either 1 or 0. The second > column is a number between 0 and 59. I need to perform a query > that returns > entries where: > > 1. IF the first column is 1, the second column is NOT 0 > 2. IF the first column is 0, the second column i

Simple query question

2004-09-20 Thread John Mistler
I have a table in which the first column is either 1 or 0. The second column is a number between 0 and 59. I need to perform a query that returns entries where: 1. IF the first column is 1, the second column is NOT 0 2. IF the first column is 0, the second column is anything. It seems simple, b

4.0.20: index being ignored in simple query

2004-09-15 Thread jim
Afternoon all The problem: I am doing a simple query on a table, comparing 2 columns to constants. The table is indexed with a compound index on these 2 columns. The join optimizer only seems to notice that the first column is indexed, and ignored the second column. The table is large (16M rows

Re: very simple query but strange results

2004-08-30 Thread Rhino
: "Michael Stassen" <[EMAIL PROTECTED]> To: "Rhino" <[EMAIL PROTECTED]> Cc: "Kapoor, Nishikant" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, August 30, 2004 7:12 PM Subject: Re: very simple query but strange results > > Rhino

Re: very simple query but strange results

2004-08-30 Thread Michael Stassen
Rhino wrote: - Original Message - From: "Kapoor, Nishikant" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, August 30, 2004 2:41 PM Subject: very simple query but strange results This little sql has me puzzled. Would appreciate your help. mysql> drop ta

Re: very simple query but strange results

2004-08-30 Thread Rhino
- Original Message - From: "Kapoor, Nishikant" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, August 30, 2004 2:41 PM Subject: very simple query but strange results This little sql has me puzzled. Would appreciate your help. mysql> drop table if e

Re: how to speed up a simple query? can anyone help with an ideea?

2004-04-21 Thread Arthur Radulescu
> Creating a combined index can help MySQL in using this index for both the > where condition and the order by clause. > Try the query with an index on cat,date and with date,cat; maybe one will be > faster than the other. This partially solved my problem. Thanks a lot. However I am facing a new p

Re: how to speed up a simple query? need some help here...

2004-04-20 Thread Arthur Radulescu
> Create composite index on (cat, date). Use EXPLAIN to see if MySQL uses index: > http://dev.mysql.com/doc/mysql/en/EXPLAIN.html This partially solved my problem. Thanks a lot. However I am facing a new problem here. The query where I am ordering by a column is much more slowly than the same que

Re: how to speed up a simple query? can anyone help with an ideea?

2004-04-20 Thread Arthur Radulescu
> 1. MySQL only uses one index for each table in a JOIN; this query only uses > one table, so only one index is used. > 2. DESC is slower than ASC > 3. Try creating an index on two columns; try cat and date, and try date and > cat. > 4. Check EXPLAIN SELECT id,name.. to see whether the right in

Re: how to speed up a simple query? can anyone help with an ideea?

2004-04-20 Thread Jigal van Hemert
> select id,name,desc,cat,date from table where cat='12' > > however I need to order the results by date desc... I have indexes on both > the cat and date (of type timestamp) fields however this operation is much > more slowly when I used the order So the result is something like this > > selec

Re: how to speed up a simple query?

2004-04-20 Thread Egor Egorov
"Arthur Radulescu" <[EMAIL PROTECTED]> wrote: > > I have a simple query on a table of about 1,000,000 records... The table is > optimized and the query is pretty simple at this moment... something like > this > > select id,name,desc,cat,date from table where cat

how to speed up a simple query? can anyone help with an ideea?

2004-04-20 Thread Arthur Radulescu
Hello! I have a simple query on a table of about 1,000,000 records... The table is optimized and the query is pretty simple at this moment... something like this select id,name,desc,cat,date from table where cat='12' however I need to order the results by date desc... I have indexes o

how to speed up a simple query?

2004-04-19 Thread Arthur Radulescu
Hello! I have a simple query on a table of about 1,000,000 records... The table is optimized and the query is pretty simple at this moment... something like this select id,name,desc,cat,date from table where cat='12' however I need to order the results by date desc... I have indexes o

Re: very simple query question

2004-04-17 Thread Jigal van Hemert
> i have a simple query > > select u.*,p.* from users u, profiles p > where u.uname = p.uname > and u.level != 0 > > Is there any tricks to make this use an index. If i do level=0 is uses an > index , but != does not. MySQL only uses an index if it will return less

very simple query question

2004-04-17 Thread Randy Paries
Hello i have a simple query select u.*,p.* from users u, profiles p where u.uname = p.uname and u.level != 0 Is there any tricks to make this use an index. If i do level=0 is uses an index , but != does not. -- MySQL General Mailing List For list archives: http

Re: stuck with simple query..... Plz have a look

2004-04-07 Thread Yayati Kasralikar
Try something like is: select a.Name as PL_Name,b.Name as PC_Name,c.Name as PA_Name from (select * from table1,table2 where table1.ID=table2.PL) a, (select * from table1,table2 where table1.ID=table2.PC) b, (select * from table1,table2 where table1.ID=table2.PA) c where a.description=b.description

RE: stuck with simple query..... Plz have a look

2004-04-07 Thread Luc Foisy
Wait, I see it now :) -Original Message- From: Luc Foisy Sent: Wednesday, April 07, 2004 10:45 AM To: [EMAIL PROTECTED] Subject: RE: stuck with simple query. Plz have a look I would like to ask a question here, just for my own knowledge. What is actually the difference between

RE: stuck with simple query..... Plz have a look

2004-04-07 Thread Luc Foisy
= Table1-1.PL LEFT JOIN Table1 Table1-2 ON Table1.ID = Table1-2.PC LEFT JOIN Table1 Table1-3 ON Table1.ID = Table1-3.PA -Original Message- From: Jim Page - EMF Systems Ltd [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 07, 2004 10:09 AM To: gerald_clark Cc: [EMAIL PROTECTED] Subjec

Re: stuck with simple query..... Plz have a look

2004-04-07 Thread Peter J Milanese
[EMAIL PROTECTED]> Subject:Re: stuck with simple query. Plz have a look Forgive me, but it would be a cartesian product if there were no where condition, I agree? It would return (size Table1)x(size Table2)^3 rows, definitely not what Tariq wants. The query I supplied will r

Re: stuck with simple query..... Plz have a look

2004-04-07 Thread Jim Page - EMF Systems Ltd
Forgive me, but it would be a cartesian product if there were no where condition, I agree? It would return (size Table1)x(size Table2)^3 rows, definitely not what Tariq wants. The query I supplied will return (size Table2)x(1)^3 rows won't it? Or am I missing the point? Jim > >SELECT ta.Name,tb.Na

Re: stuck with simple query..... Plz have a look

2004-04-07 Thread gerald_clark
Jim Page - EMF Systems Ltd wrote: SELECT ta.Name,tb.Name,tc.Name,Description FROM Table2,Table1 ta,Table1 tb,Table1 tc WHERE ta.ID=PL AND tb.ID=PC AND tc.ID=PA; Should work Jim (This email has been scanned for viruses by www.emf-systems.com) I t may work, but it may consume all ram and di

RE: stuck with simple query..... Plz have a look

2004-04-07 Thread Jim Page - EMF Systems Ltd
SELECT ta.Name,tb.Name,tc.Name,Description FROM Table2,Table1 ta,Table1 tb,Table1 tc WHERE ta.ID=PL AND tb.ID=PC AND tc.ID=PA; Should work Jim (This email has been scanned for viruses by www.emf-systems.com) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To uns

stuck with simple query..... Plz have a look

2004-04-07 Thread Jim Page - EMF Systems Ltd
Looks like I trod on original post - forgot to add RE: to subject. Sorry about that! Jim (This email has been scanned for viruses by www.emf-systems.com) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

stuck with simple query..... Plz have a look

2004-04-07 Thread Jim Page - EMF Systems Ltd
SELECT ta.Name,tb.Name,tc.Name,Description FROM Table2,Table1 ta,Table1 tb,Table1 tc WHERE ta.ID=PL AND tb.ID=PC AND tc.ID=PA; Jim (This email has been scanned for viruses by www.emf-systems.com) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

stuck with simple query..... Plz have a look

2004-04-07 Thread Tariq Murtaza
We have two tables Table1: - ID |Name 1 |name1 2 |name2 3 |name3 4 |name4 Table2: --- PL | PC

Re: Similar simple query slow down dramatically, by just select one more field, why?

2004-02-18 Thread Oscar Yen
N¬™ë,j°jËkj{zºÞw­…«k‰©oz»"¢z ‰¦ºx†j×­˜úèThanks for reply. - Original Message - From: "Ludwig Pummer" <[EMAIL PROTECTED]> To: "Oscar Yen" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, February 19, 2004 8:39 AM Subject: Re: Simi

Re: Similar simple query slow down dramatically, by just select one more field, why?

2004-02-18 Thread Ludwig Pummer
Oscar Yen wrote: create table a ( imgid int not null, parent int, imgtype char(3), img longtext, primary key (imgid), key searchkey (parent, imgid) ) type = innodb; T1) select imgid, parent from a where parent = 10; returns 3357 rows in 0.08 sec. T2) select imgid, parent, imgtype fr

Similar simple query slow down dramatically, by just select one more field, why?

2004-02-18 Thread Oscar Yen
N¬™ë,j°jËkj{zºÞw­…«k‰©oz»"¢z ‰¦ºx†j×­˜úèDear all, I have asked the question days before, but no one seems interested in it Considering table imgstore, defined as create table a ( imgid int not null, parent int, imgtype char(3), img longtext, primary key (imgid), key searchke

RE: I can't figure out what I thought would be a simple query..

2003-10-28 Thread Mike Knox
e- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: 27 October 2003 22:30 To: Jim Matzdorff; MySQL List Subject: RE: I can't figure out what I thought would be a simple query.. I'm interested to see what kind of solution is offered for this as I could use it myself. I'm having to

Re: I can't figure out what I thought would be a simple query..

2003-10-27 Thread Matt W
ike the subselect method would have this problem also. Can someone tell me if this is true or am I thinking wrong? Hmm. Hope that helps. Matt - Original Message - From: "Larry Brown" Sent: Monday, October 27, 2003 4:29 PM Subject: RE: I can't figure out what I thought w

RE: I can't figure out what I thought would be a simple query..

2003-10-27 Thread Larry Brown
PROTECTED] Subject: I can't figure out what I thought would be a simple query.. All; I am having tremendous trouble attempting to do the following query; and any help would be appreciated. I am using Mysql 4.0.15a; and I cannot upgrade. Given the following TEMPORARY table (it's a table

I can't figure out what I thought would be a simple query..

2003-10-27 Thread Jim Matzdorff
All; I am having tremendous trouble attempting to do the following query; and any help would be appreciated. I am using Mysql 4.0.15a; and I cannot upgrade. Given the following TEMPORARY table (it's a table I have created from a whole host of sources): table: endtime_table +

Re: mysqld consumes 1.3Gb of swap for simple query on solaris

2003-09-19 Thread Matt W
gt; Sent: Friday, September 19, 2003 5:19 PM Subject: mysqld consumes 1.3Gb of swap for simple query on solaris > >Description: > > A particular simple mysql query, > including FORMAT, count, and group commands, run on a very small > table, causes mysqld to consume about 1300 M

mysqld consumes 1.3Gb of swap for simple query on solaris

2003-09-19 Thread kilsdonk
un4u sparc SUNW,Sun-Blade-1000 (Also tried an Ultra-2 running 5.7, behaved the same). Thanks, Tom Kilsdonk >Fix: >Submitter-Id: >Originator: >Organization: >MySQL support: [none | licence | email support | extended email support ] Synopsis: mysq

mysqld consumes 1.3Gb of swap for simple query on solaris

2003-09-19 Thread tomkilsdonk
QL support: [none | licence | email support | extended email support ] >Synopsis: mysqld consumes 1.3Gb of swap for simple query on solaris >Severity: >Priority: >Category: mysql >Class: sw-bug >Release: mysql-3.23.55 (Source distribution) >Se

Re: Simple query help

2003-08-30 Thread Roger Baklund
* Boris Villazon > El vie, 29-08-2003 a las 22:05, Daniel Clark escribió: > > > select value from tableName where date in (select max(date) > > > from tableName where id = 4); > > > > > > But, it doesn't work with mysql 4.0. > > > > > > Any ideas? Does anybody had this problem before? > > > > What

Re: Re: Simple query help

2003-08-30 Thread Boris Villazon
El vie, 29-08-2003 a las 22:05, Daniel Clark escribió: > > select value from tableName where date in (select max(date) from > > tableName where id = 4); > > > > But, it doesn't work with mysql 4.0. > > > > Any ideas? Does anybody had this problem before? > > What about: > > SELECT value, date > FR

Re: Simple query help

2003-08-29 Thread Daniel Clark
> select value from tableName where date in (select max(date) from > tableName where id = 4); > > But, it doesn't work with mysql 4.0. > > Any ideas? Does anybody had this problem before? What about: SELECT value, date FROM tablename WHERE id = 4 ORDER BY date ASC Just pick the first row.

  1   2   >