RE: deleting frequently = OK?

2002-09-10 Thread Erick Papadakis
sql, query thanks for the note brent. > If you don't have any variable length > fields (ie. varchar) then all your record > lengths are exactly the same and the > "empty" space can be reused for new records, > preventing fragmentation. i think we can do this. sin

deleting frequently = OK?

2002-09-10 Thread Erick Papadakis
hello sql, query for various reasons, i need to do a cron job that will take a snapshot of table1 (by snapshot i mean a temporary table), do some processing, and then save some scientific calculations to table2. after this, i need to "refresh" table1 -- i.e., truncate it entirely. i need to d

Constant deletion/truncation = OK? (help with a scenario)

2002-09-05 Thread Erick Papadakis
hi, i have a need for inserting into a table very frequently (several 1000s of records per minute). now, at the end of every hour or so, i need to tally the records in the first table, put ONLY the counts into a second table, and then delete the thousands of entries in the first one which are use

problem with date/time column

2002-09-04 Thread Erick Papadakis
hi, i have a date/time column. i insert into it using "now()". works fine. now i want a query where data/time is either today or yesterday. how should i do it? thanks/erick __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://f

mysql order by a group = HORRIBLY SLOW

2002-08-20 Thread Erick Papadakis
please help! i have all indices in place and my sql queries are all very fast etc. UNTIL i do the following: select count(id) ,count(distinct username) thecount from appviews group by id order by thecount briefly put, this query tries to get the the overall views f

question about ANALYZE TABLE

2002-08-12 Thread Erick Papadakis
i noticed this on the mysql website: I found that when EXPLAIN gives unexpected results (like using another index than the one you created especially for this goal), first running ANALYZE TABLE on the involved tables helped a lot. I put an ANALYZE TABLE for 10 or so "key" tables in the nigh

help with replacing OR in query

2002-08-12 Thread Erick Papadakis
p.s., if you reply, kindly CC me as well. hi, i have the following SQL query select col1 from table1 where col2 = 'xxx' or col3 = 'xxx' how can i get rid of this OR? due to my table design and the logic involved, i have to check both these 2 columns (in a search function). i cannot

OR replaced by REGEXP?

2002-07-30 Thread Erick Papadakis
thanks for those who helped about my OR query in the join, if the sql containes "IN (something)" it is much faster. but i have a similar question relating to regexp. sorry i am not too good with regexp so wouldapprecite some help. my sql is like this: where col1 like '%abc%' or col1 like '%

"OR" in the JOIN clause -- very very slow!

2002-07-28 Thread Erick Papadakis
hello, i have a couple of questions about my SQL query. 1. if i want all rows in table 1 that may or may not have a counterpart row in table 2, i use LEFT JOIN. this is HORRIBLY slow! why? if i make it a simple join (i.e., without the words "LEFT JOIN") then it is a little faster. 2. secondly

Search SQL optimization

2002-07-24 Thread Erick Papadakis
Let us say I have two tables tab1 and tab2. tab1: col1 col2 tab2: col3 col4 For my search, a user can enter space delimited words to search, e.g., microsoft windows xp i have to search for EACH of these words, and join the 2 tables too, so my sql query looks somewhat like thi

Re: Rewind the auto_increment index?

2002-07-17 Thread Erick Papadakis
> sql,query > > > hello. > > let us say i have a table: > >customers >idint(10) auto_increment >name varchar(20) > > > whenever i do, > >insert into customers (name) values ('...'); > > it automatically generates the id, right? that is the meaning of the > a

Re: SQL query help

2002-07-13 Thread Erick Papadakis
Hi Craig, you wrote--- > select B.name,C.name > from lookuptable A, user B, cat C > where A.user = B.id > and A.category = C.id > and A.category in (3,5); > > The problem I see is that records come back where a user is in category > 3 or > category 5. How do I limit

RE: mysql primary key question!

2002-07-09 Thread Erick Papadakis
uld be great if you'd post it > to > the mysql list. > > Carl McNamee > Systems Administrator > Billing Concepts > (210) 949-7282 > > -Original Message- > From: Erick Papadakis [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 08, 2002 6:30 AM > To:

mysql primary key question!

2002-07-08 Thread Erick Papadakis
hello, i hope some database guru can help me with this! i need to set up an auto_increment field inside mysql. for various reasons, the maximum size is 3. but i don't want this to be ONLY integers because that limits me until 999 numbers only. since i have all flexibility for these three digi

reproducing windows mysql database on a linux box?

2001-02-11 Thread Erick Papadakis
hello, i ve been trying out a database in windows nt and it works. but now i want to move the database to a linux platform, is there some way i can just copy the data files and they will work? with privileges and all? what is the best and the fastest way to do this? thanks/erick _

If-then-else in MySQL selects, like DECODE in Oracle?

2001-02-07 Thread Erick Papadakis
hi does mysql support any equivalent of DECODE in oracle? i have been looking all over for info on this, but cannot find any. i have several SQL scripts in our code that use the decode stmt, and now that some of our stuff is being ported to MySQL, i have hit a wall. will i have to get my perl