Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!ginosko!brutus.cs.uiuc.edu!lll-winken!lll-lcc!unisoft!mtxinu!sybase!jeffl@sybase.Sybase.COM From: jeffl@sybase.Sybase.COM (Jeff Lichtman) Newsgroups: comp.databases Subject: Re: Parsing Query Languages in the Client or Server Message-ID: <6333@sybase.sybase.com> Date: 28 Sep 89 06:47:02 GMT References: <641@daitc.daitc.mil> Sender: news@sybase.sybase.com Lines: 32 Here's how it is: in order for the front end to do validation of column names, table names, datatypes, etc., it has to send queries to the server. For example: select mycolumn from mytable On Sybase, one might use the following queries to validate the above query: select id from sysobjects where name = 'mytable' select colid from syscolumns where id = :id and name = 'mycolumn' Now, suppose the first query (the one we're trying to validate) is wrong (for example, either the table or column doesn't exist). We can save the cost of sending the query to the server by validating it in the front end, but only at the cost of running the other two queries. This is actually worse than just sending the first query and seeing whether it will run. After all, the server has to do the two validation queries even for a valid query (it needs the table and column ids). This can be done more efficiently in the server by using hard-wired access method calls. I assume, by the way, that we're not talking about validating the user's query just so we can send the unmodified text of that query to the server. That would be a terrible way of doing it. In that case, the server would still have to validate the query once the front end decided it was safe to send, so in the best case, the validations would be costly, and in the worst case, they would have to be done twice. We're still talking about sending parse trees across the network, aren't we? --- Jeff Lichtman at Sybase {mtxinu,pacbell}!sybase!jeffl -or- jeffl@sybase.com "Saints should always be judged guilty until they are proved innocent..."