CHAR vs TEXT and fast Row Updates

2006-01-17 Thread Karl Pielorz


Hi All,

We have an application that needs to update rows in the database 'as fast 
and efficiently' as possible.


To this end, we've tried re-designing the table - can someone clarify the 
following assumptions we're about to make?



1. Fixed length CHAR fields are quicker to update than VARCHAR fields 
(because the field size is constant)


2. If we 'pre-create' 5,000 records in a table - and run an UPDATE on this, 
to 'replace' records in the table - it will be faster than if we run a 
'DELETE' followed by 'INSERT' operation on the table (to keep the number of 
records to 5,000)



The only other query I have is regarding TEXT fields. Some of the data in 
the table isn't big enough to be held in a CHAR/VARCHAR column (i.e. it's 
over 255 characters).


Do we get any 'saving' by using a TEXT field, and pre-populating this with 
say 2K of 'spaces' when we create the 5,000 rows - and then ensuring that 
the UPDATE operation always writes 2K of text to the field? - e.g. will 
this avoid MySQL having to 'free up' the space for the field, then 
re-allocate 2K again for it.


Or is it not that 'clever'?

I realise the savings from the above could be fairly small, but when you're 
processing thousands of updates an hour, it all adds up - if we can have 
MySQL doing 'less work' for the updates.



Thanks in advance,

-Karl

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: How to get the last record from the slected record set

2004-08-23 Thread Karl Pielorz

--On 22 August 2004 21:05 +0800 Manisha Sathe <[EMAIL PROTECTED]> 
wrote:

I want to select first 10 records out of 100. And then get the 10th
position.
If i make use of
order by score asc limit 1
then I will get 100th record, How shall i pick up 10th position?
I'm not quite sure I follow what you're aiming for, but have you tried...
limit 10,1
i.e. return 1 record, starting at row 10 in the result set. Beyond that 
you'd have to explain what 'score' is, as it's getting a little 
confusing... :)

-Kp
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: How to get the last record from the slected record set

2004-08-23 Thread Karl Pielorz

--On 22 August 2004 20:31 +0800 Manisha Sathe <[EMAIL PROTECTED]> 
wrote:

I am having more than 10 records in a table. I want to select only first
top 10 records (depending on one field score) and then want to select
10th position record.
select * from table1 order by score desc LIMIT 10
This will give me 10 records but then how to get the last record ?
order by score asc limit 1
[i.e. turn it around and pick the 1st (which will be the last because it's 
ordered the other way)]

:-)
-Kp
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Help in Administration

2001-08-05 Thread Karl Pielorz

On 05 August 2001 23:42 -0700 Schajee Achmad wrote,

> now I get this error "Access Denied
> for user: 'root@localhost' (Using password: NO).
>
> I've tried several ways o get out of this mess, even
> the documentation of MySQL but there is no mention of
> this error.

Run up mysql with the '--skip-grant-tables' option, which will cause the 
server to come up, and ignore the permissions table, so you should be able 
to login, fix the problem up, and then _remember_ to re-start the server 
again without this option, or you'll give full access to everyone...

Regards,

-Kp

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php