Index question

2011-10-11 Thread Alex Schaft
If you have a table with columns A & B, and might do a where on A or B, or an order by A, B, would single column indexes on A and B suffice or would performance on the order by query be improved by an index on A,B? Thanks -- MySQL General Mailing List For list archives: http://lists.mysql.co

Re: Why the same command have different results when it is in a bash script and when it is not?

2011-10-11 Thread Johan De Meersman
I don't have a direct answer for you, just some thoughts: * traditionally, "localhost" is thought of as an alias for 127.0.0.1 * mysql however, tends to not interpret it like when connecting to the local server and instead tries to connect to the socket * to force mysql client to connect over

Re: Index question

2011-10-11 Thread Johan De Meersman
- Original Message - > From: "Alex Schaft" > > If you have a table with columns A & B, and might do a where on A or > B, or an order by A, B, would single column indexes on A and B suffice > or would performance on the order by query be improved by an index on > A,B? Depends on usage :-)

Re: Index question

2011-10-11 Thread Neil Tompkins
Just to clarify having key indexes of (a,b) or (b,a) have no difference ? On 11 Oct 2011, at 09:36, Johan De Meersman wrote: > - Original Message - >> From: "Alex Schaft" >> >> If you have a table with columns A & B, and might do a where on A or >> B, or an order by A, B, would single

Re: Index question

2011-10-11 Thread Arthur Fuller
The difference is based on the relative frequency of queries where a is important vs. where b is important. Either way, what will happen is that the index scan will isolate the first item mentioned, then scan the result set to isolate the second term. e.g. SELECT * FROM someTable WERE a = someVal

Re: Index question

2011-10-11 Thread Rik Wasmus
> Just to clarify having key indexes of (a,b) or (b,a) have no difference ? They DO. See it as lookup table which starts with 'a' in the first case, and 'b' in the second one. Looking for anything that matches 'b' for an index (a,b) requires a full scan as you don't know 'a', likewise searchin

Re: Index question

2011-10-11 Thread Alex Schaft
On 2011/10/11 02:22 PM, Rik Wasmus wrote: Just to clarify having key indexes of (a,b) or (b,a) have no difference ? They DO. See it as lookup table which starts with 'a' in the first case, and 'b' in the second one. Looking for anything that matches 'b' for an index (a,b) requires a full scan

Re: Index question

2011-10-11 Thread Alex Schaft
On 2011/10/11 02:30 PM, Alex Schaft wrote: On 2011/10/11 02:22 PM, Rik Wasmus wrote: Just to clarify having key indexes of (a,b) or (b,a) have no difference ? They DO. See it as lookup table which starts with 'a' in the first case, and 'b' in the second one. Looking for anything that matches

Re: Index question

2011-10-11 Thread Rik Wasmus
> Next question. If you have the two separate indexes and then do two > queries, one for a and one for b. If you then get a list of unique id's > of both, would it be faster to create an intersection yourself rather > than have the server do the legwork? If you only have 2 unrelated indexes on a &

Re: Index question

2011-10-11 Thread Neil Tompkins
In this instance would you create four indexes key(a) key(b) key(a,b) key (b,a) ? Or is the decision based on the query response time ? On 11 Oct 2011, at 13:40, Rik Wasmus wrote: >> Next question. If you have the two separate indexes and then do two >> queries, one for a and one for b. If you

Re: Index question

2011-10-11 Thread Rik Wasmus
> In this instance would you create four indexes key(a) key(b) key(a,b) key > (b,a) ? Or is the decision based on the query response time ? Depends on the data and usage, but probably I'd go for a index(a,b) & index(b,a) if reads heavily outnumber writes. As index(a) is covered by index(a,b), a

Inconsistent query result.

2011-10-11 Thread Paul Halliday
I have the following query: SELECT COUNT(signature) AS count, MAX(timestamp) AS maxTime, INET_NTOA(src_ip), map1.cc as src_cc, INET_NTOA(dst_ip), map2.cc as dst_cc, signature, signature_id, ip_proto FROM event LEFT JOIN mappings AS map1 ON event.src_ip = map1.ip LEFT JOIN mappings AS map2 ON event

Re: Inconsistent query result.

2011-10-11 Thread Peter Brawley
On 10/11/2011 8:11 AM, Paul Halliday wrote: I have the following query: SELECT COUNT(signature) AS count, MAX(timestamp) AS maxTime, INET_NTOA(src_ip), map1.cc as src_cc, INET_NTOA(dst_ip), map2.cc as dst_cc, signature, signature_id, ip_proto FROM event LEFT JOIN mappings AS map1 ON event.src_ip

Re: Index question

2011-10-11 Thread Johan De Meersman
- Original Message - > From: "Rik Wasmus" > > Depends on the data and usage, but probably I'd go for a index(a,b) & > index(b,a) if reads heavily outnumber writes. As index(a) is covered > by index(a,b), and index(b) by index(b,a), we don't need to add those, > which saves time on modifi

Re: Initial install instructions for mac lion/macports

2011-10-11 Thread Brandon Phelps
Is there any reason why you are using ports and not the native 64-bit DMG from mysql.com? http://www.mysql.com/downloads/mysql/#downloads I run the latest version (5.5.15) on my macbook running lion and the install goes without a hitch. Brandon On 10/10/2011 07:34 PM, Tim Johnson wrote: I f

Re: Initial install instructions for mac lion/macports

2011-10-11 Thread Vladislav Geller
Hi Brandon, MacPorts is practically dead. I tihnk you will have more luck with http://mxcl.github.com/homebrew/ I have not built mysql with it though on lion. regards, Vladislav On Tue, Oct 11, 2011 at 3:56 PM, Brandon Phelps wrote: > Is there any reason why you are using ports and not the na

Re: Initial install instructions for mac lion/macports

2011-10-11 Thread Brandon Phelps
I only use ports for a very few number of apps, such as irssi, newer versions of perl, etc. I was recommending the OP use the DMG installer, as it comes with everything necessary, including startup scripts. -Brandon On 10/11/2011 10:05 AM, Vladislav Geller wrote: Hi Brandon, MacPorts is pra

Re: Beginner question

2011-10-11 Thread Andrew Moore
Hey, welcome to the lists, Be mindful that your query is using 2 tables and 'SELECT *'. On Tue, Oct 11, 2011 at 4:11 PM, Biz-comm wrote: > I am trying to write a query for a web page that shows a list of users in a > particular group. > > There are 3 tables: > pm1_users that uses UserID > pm1

Re: Beginner question

2011-10-11 Thread Johan De Meersman
- Original Message - > From: "Andrew Moore" > > Be mindful that your query is using 2 tables and 'SELECT *'. Which probably means not so much to someone who doesn't even know what a join is :-) Have a look at http://www.w3schools.com/sql/sql_join.asp . -- Bier met grenadyn Is als

Re: Initial install instructions for mac lion/macports

2011-10-11 Thread Tim Johnson
* Tim Johnson [111010 15:37]: > I familiar with mysql on linux, as of late - ubuntu. > I am installing mysql on a mac mini, with the Lion - osx 10.7 > operating system. > > mysql-server was downloaded and built with macports. > Following instructions included has not resulted in a successful > st

Re: Beginner question

2011-10-11 Thread Biz-comm
Thanks for the pointer. Digging out reference books to learn how to do a join. :-) On Oct 11, 2011, at 11:23 AM, Johan De Meersman wrote: > Which probably means not so much to someone who doesn't even know what a join > is :-) > > Have a look at http://www.w3schools.com/sql/sql_join.asp . R

Re: Initial install instructions for mac lion/macports

2011-10-11 Thread Brandon Phelps
Tim, Just a reminder, as I am not sure if it is documented or not; After you get MySQL up and running via the DMG package be sure to install the System Preferences pane (it didn't use to install by default, not sure if it does now) which should be one of the icons you get when the DMG first o

Re: Initial install instructions for mac lion/macports

2011-10-11 Thread Tim Johnson
* Brandon Phelps [111011 07:43]: > Tim, > Just a reminder, as I am not sure if it is documented or not; > After you get MySQL up and running via the DMG package be sure to > install the System Preferences pane (it didn't use to install by > default, not sure if it does now) which should be one o

Re: Inconsistent query result.

2011-10-11 Thread Paul Halliday
On Tue, Oct 11, 2011 at 10:37 AM, Peter Brawley wrote: > On 10/11/2011 8:11 AM, Paul Halliday wrote: >> >> I have the following query: >> >> SELECT COUNT(signature) AS count, MAX(timestamp) AS maxTime, >> INET_NTOA(src_ip), map1.cc as src_cc, INET_NTOA(dst_ip), map2.cc as >> dst_cc, signature, sig

Re: Inconsistent query result.

2011-10-11 Thread Johan De Meersman
- Original Message - > From: "Paul Halliday" > > Is it OK to keep adding to those joins? In a view there could be say > 50 countries. The user can keep on adding more to exclude. So would I > just expand on the ANDs like so: > > AND map1.cc !='CA' AND map1.cc !='US' AND map1.cc !='LV'...

Null Output Problem

2011-10-11 Thread Jon Forsyth
Hello, I have a problem with the following query: SELECT subject_identifier, COUNT(*) FROM asr_sentence_score WHERE total_words = correct_words GROUP BY subject_identifier; OutPut: ++--+ | subject_identifier | COUNT(*) | ++--+ |

Re: Index question

2011-10-11 Thread Tompkins Neil
Thanks for the information. One final question in what ways should we use EXPLAIN EXTENDED statement to help improve our query performance. On Tue, Oct 11, 2011 at 2:51 PM, Johan De Meersman wrote: > - Original Message - > > From: "Rik Wasmus" > > > > Depends on the data and usage, but

Re: Inconsistent query result.

2011-10-11 Thread Peter Brawley
On 10/11/2011 12:26 PM, Paul Halliday wrote: On Tue, Oct 11, 2011 at 10:37 AM, Peter Brawley wrote: On 10/11/2011 8:11 AM, Paul Halliday wrote: I have the following query: SELECT COUNT(signature) AS count, MAX(timestamp) AS maxTime, INET_NTOA(src_ip), map1.cc as src_cc, INET_NTOA(dst_ip), ma

Re: Null Output Problem

2011-10-11 Thread Hal�sz S�ndor
Generally when one has this problem one joins this query with something from which one can get the whole list, something like this: SELECT identifier, IFNULL(c, 0) AS Good, (query with COUNT) AS P RIGHT JOIN table-of-identifiers ON P.identifier = table-of-identifiers.identifier The "c" is

Vista crashes

2011-10-11 Thread Hal�sz S�ndor
I find that, when under Vista the MySQL daemon has been shut down, by giving the command start mysqld -b"%CD%" in the root directory where MySQL 5.5.8 (the version running on this computer) has been stored from an instance of command prompt with administrator authority issued by a user that lack

Re: Vista crashes

2011-10-11 Thread Reindl Harald
so why do you search a list of known bugs instead update your mysql? 5.5.8 is the FIRST ga version of 5.5 currently we have 5.5.16 no, i do not know if 5.5.16 is solving your problem but hwat i know is that the updates were bot relöeased just for fun Am 12.10.2011 06:28, schrieb Hal?sz S?ndor: >