Archive for the ‘Development’ Category

Why do people use MySQL again?

I haven’t worked with MySQL in quite a while, and lately I have been doing heavy amounts of Transact SQL programming with MSSQL for my work. So when a friend of mine asks me a question about a MySQL query he wrote and I reply with “Well, what does the execution plan look like?”, I was rather surprised when he reminded me that execution plans in MySQL are all determined at runtime by the MySQL optimizer so they are semi random. I asked him to explain and he did, and what he described absolutely boggled my mind as to why people tolerate MySQL.

Now, correct me if I’m wrong with this but, with MySQL there is no way to create stored procedures like you can with MSSQL (Stored procedures are basically queries that are optimized and compiled and stored as database objects that you can execute and pass variables into, sort of like UDF’s except they aren’t performance hogs like UDF’s are). This means that all of the MySQL queries are essentially inline SQL in whatever code you are developing, and have to be optimized and compiled at runtime (This also can cause problems for code maintenance if you have similar queries that are spread over say 20 different files, although this can be made easier if you use some sort of SQL query handler object that builds the simpler queries based on arrays of data you pass to it). Now, as my friend explained, the problem with MySQL is that the optimizer will sometimes look at the records and if it determines that enough of the data is similar in a certain column it will ignore the index entirely. This basically results in semi-random execution plans since the index might change based off of the records being used.

I tried to find some articles online that explain similar issues to this with MySQL but I was unable to, but if this is true I might have to avoid using MySQL in the future because having to deal with that would be a nightmare.

Surrealist Compliment Generator

I was linked to this fun page a while ago.

So I decided to make a LSL script that pulls compliments from that page and spits them into chat.

Enjoy!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//Script by Richard Keast
//SL Name: Sam Darrow
//
//Surrealist Compliment Generator (http://www.madsci.org/cgi-bin/cgiwrap/~lynn/jardin/SCG)
//Is Copyright 1994-1999 Banjo Ruthless Creations

key requestid;

default
{
touch_start(integer total_number)
{
requestid = llHTTPRequest("http://www.madsci.org/cgi-bin/cgiwrap/~lynn/jardin/SCG",[],"");
}

http_response(key request_id, integer status, list metadata, string body)
{
if(requestid == request_id)
{
integer strpos_1 = llSubStringIndex(body, "
<h2>") + 6;
integer strpos_2 = llSubStringIndex(body, "</h2>
") - 1;
body = llGetSubString(body, strpos_1, strpos_2);

llSay(0 ,llDumpList2String(llParseString2List(body, ["\n"," "], []), " "));
}
}
}
Return top

PURPOSE

This blog is very simple in it's purpose as it is merely a place for me to rant about the events of my life and the projects that I am involved in.

I hope that you might find something within my posts that you will find enjoyable.