Re: database engine
Posted in 1992
In article <8865@emory.mathcs.emory.edu> Doimic01@saad-emh1.ARMY.MIL asks a lot of questions: >What exactly does the background process "sqlexec" do? >(Note: the equivalent process is called "pstartsql" on PC version). The engine does the actual file operations to read, write and update the files that comprise the database. >Specifically, is the sqlexec program parsing the SQL statements >("SELECT * FROM foo"), or are they pre-parsed to some intermediate >form? Your 4GL and ESQL "SELECT" statements may be slightly parsed down in the generated C code but mostly, the engine gets it as you coded it. > How is information passed back and forth between the >4gl/esql-C program and the database engine? We currently use a pair of [unnamed] pipe files for the interprocess communication. The application sends the request up to the engine via the send-side of the pipe and gets data back vie the receive side. > For example, if a query >returns 100 rows from a table, how can a pointer to this information >be passed back to the calling program? The application tells the engine "hand me the next row" and the engine sends it across the pipe or tells the application "No more". > Why can't all functions >that the engine fulfills be incorporated into the 4gl/esql-C >program itself? Why must we have this phantom program floating >around in the background? If you want this power in the hands of every user you can use C-ISAM to access your files directly. The [standard] engine itself is built as a big C-ISAM application. However, each user must have priveleges at the UNIX level to access the files, a minor administrative head- ache. A bigger pain (centered at other parts of one's anatomy ;-) is the simple fact that each such user has the power to reduce each file to 0 bytes by a simple shell command: cat >file.dat. By contrast, these headaches cannot happen if the engine is the only process doing the actual reads. Since the files belong to informix no regular user has the ability to mess with it at the Unix level. The engine, which runs as <user: root, group: informix> has this right but simply does not do so; it uses this privelege to handle the data according to the user's request. Obviously, I have simplified things considerably. Informix offers classes that do a much better job at these explanations than can be done in a simple posting. >The purpose of sqlexec is not addressed in the documentation, since we >aren't supposed to be interested in the internal-guts of how the >database works. So, this is a fine chance for an I-Guru to show off. I doubt that my colleagues would consider me much of a guru. The client-server model is now a fairly common technique for many situations besides databases. >Curiously Yours, >Todd Glidden >doimic01@saad-emh1.army.mil Curiouserly mine: What does your login ID have to do with your name? >Disclaimer: The questions/opinions expressed are mine and mine alone. > If my employers were aware of my opinions, they would most > assuredly tell me to get back to work. ---------------------------------------------------------------------- -- ----------------Obligatory smart-$$$ remark:--------------------- | There's two kinds of people: Those who categorize people into | | two groups and those who don't. (Aging proverb.) | -----------------------------------------------jacob@informix.com