Re: database engine
Posted in 1992
> What exactly does the background process "sqlexec" do?
SQLEXEC is the heart of the database engine. In reality, it's one of
the really NEAT parts about how Informix works.
Rather than having all of the SQL processing, etc inside of the 4GL/ESQL,
Informix has created a backend process to handle all of the actual data
processing. This has billions and billions of advantages, but I'll
only point out a few :-)
o Engine Independance
By having the engine a seperate process, all the program needs to
know is how to open up a pathway between itself and the engine,
rather than the mechanics of being the engine itself. This allows
you to run the same front end code (Your applications, ISQL, WingZ)
on any engine, SE, OnLine, I-NET, or even possbily someone elses
engine entirely. You do this by communicating to the engine your
requests using some protocol. In theory, your code never changes
regardless which engine you're running on.
o Security
With Informix, your process does not need any special permissions
to access the data. The engine does it all for you, so you can have
a secure database with an insecure front end. The engine enforces
the security itself. If all of this was in your code, then someone
somewhere could hack your code to possbily usurp the security.
o Performance
Particularly with networks, the engine crunches all of the data
itself without your program touching any of it until the your
request is met. No doubt you've probably discovered that it's
faster to do some thing like:
SELECT * from table where unkeyed_field="N"
Than to do something like:
SELECT * form table
FOREACH record
if unkeyed_field="N" then
bla bla bla
end if
END FOREACH
The engine only sends you what you request, doing most of the
filtering itself. The 4GL is nowhere near as effeicient doing
loops and such as the engine is. And with networks, your bandwidth
isn't chewed up with a bunch of generally useless data.
(Speaking of bandwidth...)
Anyway, those are some of the key points to why it's a seperate process.
I don't know if Informix documents how you can call their engine with a
custom program, I gather that is what ESQL/C is for.
I guess in summary, it's faster to dial 411 than it is to look it up.
Will
(uunet!la4gen!villy)