Re: Howto optimize Distinct query over 1.3mil rows?

2010-09-28 Thread John Stoffel
Johnny> BIB_ID is VARCHAR, you should probably try Johnny> WHERE BIB_ID='464' so MySQL treats the value as a string Wow! What a difference that makes! Time to A) update my queries, or B) fix the DB schema to NOT use varchar there. mysql> select SQL_NO_CACHE distinct(Call_No) from Newspap

Re: Howto optimize Distinct query over 1.3mil rows?

2010-09-28 Thread Johan De Meersman
If Cal_NO is a recurring value, then yes, that is the way it should be done in a relational schema. Your index cardinality of 15.000 against 1.3 million rows is reasonable, although not incredible; is your index cache large enough to acccomodate all your indices ? On Tue, Sep 28, 2010 at 5:02 PM

Re: Howto optimize Distinct query over 1.3mil rows?

2010-09-28 Thread Johnny Withers
BIB_ID is VARCHAR, you should probably try WHERE BIB_ID='464' so MySQL treats the value as a string JW On Tue, Sep 28, 2010 at 10:02 AM, John Stoffel wrote: > > Hi, > > I'm running MySQL 5.0.51a-24+lenny3-log on a Debian Lenny box with > 2Gb of RAM and a pair of dual core 2.6Ghz CPUs. I'm u

Howto optimize Distinct query over 1.3mil rows?

2010-09-28 Thread John Stoffel
Hi, I'm running MySQL 5.0.51a-24+lenny3-log on a Debian Lenny box with 2Gb of RAM and a pair of dual core 2.6Ghz CPUs. I'm using a pair of 40Gb disks mirrored using MD (Linux software RAID) for both the OS and the storage of the mysql DBs. My problem child is doing this simple query: mys

Re: Distinct Query Problem

2008-12-23 Thread Tompkins Neil
exact > columns interms of wat is suppliers which table is it coming from > etc. > > -Original Message- > From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] > Sent: Monday, December 22, 2008 5:16 PM > To: Baron Schwartz; [MySQL] > Subject: Re: Distinct Query Probl

Re: Distinct Query Problem

2008-12-22 Thread Brent Baisley
On Fri, Dec 19, 2008 at 1:03 PM, Tompkins Neil wrote: > Hi, > > I've the following query which I'm having problems with. Basically I have > a 5 tables as follows : > > MasterTB - Contains list of master records > LookupTB - Contains relationship between MasterTB to ProductTB > ContentTB - Contain

Re: Distinct Query Problem

2008-12-22 Thread Tompkins Neil
OK, I've made further progress by changing GROUP BY ProductTB.ProductID, MasterTB.MasterID to GROUP BY MasterTB.MasterID. However ProductTB.Supplier is showing the incorrect Supplier. Why is this ? Thanks Neil On Mon, Dec 22, 2008 at 11:45 AM, Tompkins Neil < neil.tompk...@googlemail.com> wrote

Re: Distinct Query Problem

2008-12-22 Thread Tompkins Neil
Hi, If anyone could point me in the right direction, I'd be most grateful. Thanks ! Neil On Mon, Dec 22, 2008 at 9:55 AM, Tompkins Neil wrote: > Hi > > I'm having trouble trying to figure this out. Any help/example would be > grateful. > > Thanks > Neil > > On Sun, Dec 21, 2008 at 4:30 PM,

Re: Distinct Query Problem

2008-12-22 Thread Tompkins Neil
Hi I'm having trouble trying to figure this out. Any help/example would be grateful. Thanks Neil On Sun, Dec 21, 2008 at 4:30 PM, Baron Schwartz wrote: > On Fri, Dec 19, 2008 at 1:03 PM, Tompkins Neil > wrote: > > > of products for all suppliers for a particular product. However I want > to

Re: Distinct Query Problem

2008-12-19 Thread Jochem van Dieten
On Fri, Dec 19, 2008 at 7:03 PM, Tompkins Neil wrote: > Basically each product is listed in the master table, and can have a number > of suppliers linked to it (ProductTB). The query above will show me a list > of products for all suppliers for a particular product. However I want to > be able to

Distinct Query Problem

2008-12-19 Thread Tompkins Neil
Hi, I've the following query which I'm having problems with. Basically I have a 5 tables as follows : MasterTB - Contains list of master records LookupTB - Contains relationship between MasterTB to ProductTB ContentTB - Contains description of product, and location of data files PriceTB - Contai

RE: DISTINCT query

2004-06-01 Thread SGreen
MAIL PROTECTED]> 06/01/2004 02:28 Fax to:

RE: DISTINCT query

2004-06-01 Thread Jack Coxen
the before and after data. Jack -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 01, 2004 1:52 PM To: Jack Coxen Cc: MySQL List (E-mail) Subject: Re: DISTINCT query Jack, I am not sure what you want your output to look like... If you want the sa

Re: DISTINCT query

2004-06-01 Thread SGreen
com> cc: Fax to: 06/01/2004 01:12 Subject: DISTINCT query

DISTINCT query

2004-06-01 Thread Jack Coxen
I'm having trouble with a query and hope someone of the list can help. I'm running version 4.0.16. I'm trying to query against two tables: mysql> DESCRIBE router; +---+-+--+-+-++ | Field | Type| Null | Key | Default | Extra