Re: more than 10000 fields in the OR clause

2007-04-17 Thread Daniel Kasak
Arun Kumar PG wrote: Guys, I know this is a stupid thing but I wanted to know if we have an index on a column X and if i have a query having 1 OR conditions on the field e.g. where X=10 OR x=12 OR x=13 OR x=15.. so on then will it give any benefits in terms of speed? Yes the index

Re: Max columns in a tabel in MyISAM storage engine

2007-04-17 Thread ViSolve DB Team
Hi, Might be column indexing have restriction over number of columns to be indexed, but for number of columns, hope you can overrider with the variables avg_row_length and max_rows during create/alter table. The length/size of the table depends on the file system(maximum file size defined

Re: Max columns in a tabel in MyISAM storage engine

2007-04-17 Thread Micah Stevens
Fabian Köhler wrote: Hello, i have table with answers to questions. Every answer is a column in the table. i.e. id|q1|q2|q3 1|answer1|answer2|answer5 2|answer3|answer4|asnwer6 another option to save it would be sth like this: id|field|value 1|q1|answer1 1|q2|answer2 1|q3|answer5

Re: Max columns in a tabel in MyISAM storage engine

2007-04-17 Thread Stijn Verholen
Fabian Köhler wrote: Hello, i have table with answers to questions. Every answer is a column in the table. i.e. id|q1|q2|q3 1|answer1|answer2|answer5 2|answer3|answer4|asnwer6 another option to save it would be sth like this: id|field|value 1|q1|answer1 1|q2|answer2 1|q3|answer5

RE: how to tell if something hasn't happened yet

2007-04-17 Thread Mogens Melander
Arg, come on, really. where t.created = date(now())); -- Later Mogens Melander +45 40 85 71 38 +66 870 133 224 On Mon, April 16, 2007 15:18, Jay Blanchard wrote: [snip] select s.* from store s where s.id not in (select t.storeid from trans t where t.created=date(now())); [/snip]

RE: how to tell if something hasn't happened yet

2007-04-17 Thread Mogens Melander
Argh, that was not the one i wanted to send :) This is the one: select s.* from store s where s.id not in (select t.storeid from trans t where t.created date(now()) - interval 1 day); -- Later Mogens Melander +45 40 85 71 38 +66 870 133 224 On Tue, April 17, 2007 09:20,

Query Pls

2007-04-17 Thread Renish koshy
I had a trial version of Navicat 7.2 in my system. Now I installed the full version 7.0.9 enterprise Navicat. After that when I run the existing query,,I get a n error message -Got error 1 from storage engine..Could you guys pls help me I noticed that when I run a small query it works..Is it

Re: Query Pls

2007-04-17 Thread Ananda Kumar
Hi Renish, What is the query that you ran, please let us know. regards anandkl On 4/17/07, Renish koshy [EMAIL PROTECTED] wrote: I had a trial version of Navicat 7.2 in my system. Now I installed the full version 7.0.9 enterprise Navicat. After that when I run the existing query,,I get a n

Re: Query Pls

2007-04-17 Thread Renish koshy
I guess it is nothing to do with the query as it was working perfectly fine be4 installing the Navicat enterprise version 7.0.9 .thanks a lot On 4/17/07, Ananda Kumar [EMAIL PROTECTED] wrote: Hi Renish, What is the query that you ran, please let us know. regards anandkl

Re: Query Pls

2007-04-17 Thread Martijn Tonies
I guess it is nothing to do with the query as it was working perfectly fine be4 installing the Navicat enterprise version 7.0.9 .thanks a lot Why don't you install 7.2 full version? Why did you go back a few versions? Martijn Tonies Database Workbench - development tool for MySQL, and

Re: more than 10000 fields in the OR clause

2007-04-17 Thread Arun Kumar PG
great. thx! On 4/17/07, Daniel Kasak [EMAIL PROTECTED] wrote: Arun Kumar PG wrote: Guys, I know this is a stupid thing but I wanted to know if we have an index on a column X and if i have a query having 1 OR conditions on the field e.g. where X=10 OR x=12 OR x=13 OR x=15.. so

Re: Max columns in a tabel in MyISAM storage engine

2007-04-17 Thread Fabian Köhler
Thanks for all the input. The problem i have with this idea: Really? Wow, my opinion is that you're trying to do in one table what you should do in two. Have a questions table, and an answers table. The answers table would have a column specifying which question they belong to. i.e.

Re: Max columns in a tabel in MyISAM storage engine

2007-04-17 Thread Fabian Köhler
I also thought about creating a materialized view with mysql by doing: create table vanswers (select ... query to get the table in the format..) or a stored procedure which generates a table like the one below, but all solutions seem to be slow like hell due to the high large joins which are

Re: Max columns in a tabel in MyISAM storage engine

2007-04-17 Thread Fabian Köhler
There is another question coming to my mind: is it possible to define a view which has more columns then put nof cols limit for storage engine here or does the same limits for a normal table apply to a view? regards, Fabian On Mon, 16 Apr 2007 23:39:40 -0700, Micah Stevens [EMAIL PROTECTED]

Re: Max columns in a tabel in MyISAM storage engine

2007-04-17 Thread Martijn Tonies
Hi, Really? Wow, my opinion is that you're trying to do in one table what you should do in two. Have a questions table, and an answers table. The answers table would have a column specifying which question they belong to. i.e. QUESTIONS int autoincrement questionID question ANSWERS int

RE: Max columns in a tabel in MyISAM storage engine

2007-04-17 Thread Jerry Schwartz
If the possible answers are not predetermined, you have a real problem. I don't know how you can optimize that. A full-text index might help, but I don't have a good understanding of the type of queries you're going to need. I am not a good person to ask about performance, nor am I familiar with

RE: Max columns in a tabel in MyISAM storage engine

2007-04-17 Thread Jerry Schwartz
I agree it is poor design, but other than putting a full text index on the answers I'm not sure what can be done. Of course, that might well be faster for retrievals; but it would be slower on insertion. I don't know which would predominate in this case. Regards, Jerry Schwartz Global

Re: Max columns in a tabel in MyISAM storage engine

2007-04-17 Thread Martijn Tonies
The right way to do this would be your second way, where there would be one row per answer. I can't really grasp how the questions and answers relate to anything else, so I'm making a lot of assumptions. If you are concerned that this technique is too slow, because it involves linking

RE: Max columns in a tabel in MyISAM storage engine

2007-04-17 Thread Jerry Schwartz
The right way to do this would be your second way, where there would be one row per answer. I can't really grasp how the questions and answers relate to anything else, so I'm making a lot of assumptions. If you are concerned that this technique is too slow, because it involves linking two tables,

Re: Max columns in a tabel in MyISAM storage engine

2007-04-17 Thread Martijn Tonies
Not necessarily. I do precisely this for a data base whose structure I do not control. I stuff |code1|code2|code3| ... Into an unused text field. The users can query on LIKE %|code2|%. The key is to have a delimiter at the start and end of the entire list, so that the string match

RE: Max columns in a tabel in MyISAM storage engine

2007-04-17 Thread Jerry Schwartz
Not necessarily. I do precisely this for a data base whose structure I do not control. I stuff |code1|code2|code3| ... Into an unused text field. The users can query on LIKE %|code2|%. The key is to have a delimiter at the start and end of the entire list, so that the string match doesn't get

RE: Max columns in a tabel in MyISAM storage engine

2007-04-17 Thread Fabian Köhler
The right way to do this would be your second way, where there would be one row per answer. I can't really grasp how the questions and answers relate to anything else, so I'm making a lot of assumptions. If you are concerned that this technique is too slow, because it involves linking two

replace / insert into with sum not working

2007-04-17 Thread Tanner Postert
i'm using the following query: REPLACE INTO vviews_total( SELECT uuser_id, sum( vviews.views ) AS views, sum( vviews.embeds ) AS embeds, sum( vviews.plinks ) AS plinks, sum( vviews.`30d` ) AS 30d, sum( vviews.`7d` ) AS 7d, sum( vviews.`24h` ) AS 24h, sum( vviews.site30d ) AS site30d, sum( site7d

Re: Max columns in a tabel in MyISAM storage engine

2007-04-17 Thread Micah Stevens
On 04/17/2007 04:18 AM, Fabian Köhler wrote: Thanks for all the input. The problem i have with this idea: Really? Wow, my opinion is that you're trying to do in one table what you should do in two. Have a questions table, and an answers table. The answers table would have a column

Re: Is an index on varchar column efficient?

2007-04-17 Thread murthy gandikota
mos [EMAIL PROTECTED] wrote: At 06:23 PM 4/15/2007, you wrote: Hi, I have a table with 2 million records but without an index or a primary key. The column upon which I want to create an index is a varchar. Will it give me any advantage when I have to do a select on the column? BTW, here

Re: Is an index on varchar column efficient?

2007-04-17 Thread murthy gandikota
Baron Schwartz [EMAIL PROTECTED] wrote: murthy gandikota wrote: Hi, I have a table with 2 million records but without an index or a primary key. The column upon which I want to create an index is a varchar. Will it give me any advantage when I have to do a select on the column? BTW,

Re: How to overwrite existing file with SELECT .. INTO?

2007-04-17 Thread Atle Veka
There is no option to do this to my knowledge. However, this would be a quick workaround: - TRUNCATE TABLE table; # clears table completely, akin to doing DROP/CREATE TABLE - INSERT INTO table SELECT .. FROM ..; On Mon, 16 Apr 2007, Amer Neely wrote: At 08:14 AM 4/13/2007, Amer Neely wrote:

Re: How to overwrite existing file with SELECT .. INTO?

2007-04-17 Thread Amer Neely
Atle Veka wrote: There is no option to do this to my knowledge. However, this would be a quick workaround: - TRUNCATE TABLE table; # clears table completely, akin to doing DROP/CREATE TABLE - INSERT INTO table SELECT .. FROM ..; Again, you missed the critical part. I'm trying to replace a

Re: How to overwrite existing file with SELECT .. INTO?

2007-04-17 Thread Paul DuBois
At 10:14 AM -0400 4/13/07, Amer Neely wrote: I'm using MySQL 5.0.21 and am trying to find out if it is possible to overwrite an existing file when using a 'SELECT ... INTO' command from the command line. Is there another parameter that can do this? I've looked through the online reference

Re: How to overwrite existing file with SELECT .. INTO?

2007-04-17 Thread Amer Neely
Paul DuBois wrote: At 10:14 AM -0400 4/13/07, Amer Neely wrote: I'm using MySQL 5.0.21 and am trying to find out if it is possible to overwrite an existing file when using a 'SELECT ... INTO' command from the command line. Is there another parameter that can do this? I've looked through the

Re: replace / insert into with sum not working

2007-04-17 Thread Baron Schwartz
Hi Tanner, Tanner Postert wrote: i'm using the following query: REPLACE INTO vviews_total( SELECT uuser_id, sum( vviews.views ) AS views, sum( vviews.embeds ) AS embeds, sum( vviews.plinks ) AS plinks, sum( vviews.`30d` ) AS 30d, sum( vviews.`7d` ) AS 7d, sum( vviews.`24h` ) AS 24h, sum(

Re: replace / insert into with sum not working

2007-04-17 Thread Michael Dykman
In most common places where a VALUES list is specified you can substitute a select statement which produces such a list. SQL is an algebra after all. The only thing wrong with the syntax of the original poster was the braces around the select statement itself. Drop them and it should work fine.

Millisecond time stamp

2007-04-17 Thread John Comerford
Hi Folks, I am putting together a table to hold log entries. I was going to index it on a field with a type of TimeStamp. Unfortunately this will not suit my needs because I could have more than one log entry per second. As far as my (limited) knowledge goes I have two options to get

Problem on millions of records in one table?

2007-04-17 Thread He, Ming Xin PSE NKG
Hi,all The number of the records in one table increase constantly. As evaluated, the amount would increase to at least 30 millions within one year. So we worry about whether mysql could handle such a big amount of records with good performance. Or need we some other solutions to avoid this

Re: Problem on millions of records in one table?

2007-04-17 Thread Dan Nelson
In the last episode (Apr 18), He, Ming Xin PSE NKG said: The number of the records in one table increase constantly. As evaluated, the amount would increase to at least 30 millions within one year. So we worry about whether mysql could handle such a big amount of records with good