Quantcast
Channel: Comments and answers for "Set-Based vs. Procedural"
Browsing all 42 articles
Browse latest View live

Answer by David 1

One of the motivations of E.F.Codd when he first proposed the Relational Model of data was to devise a system that didn't require the looping, branching and step-at-a-time processing used in imperative...

View Article



Answer by Matt Whitfield

The best analogy I have seen comes from Jeff Moden's signature on the main site. And that is that with procedural code you are probably thinking about what you want to do to a row. With set-based code...

View Article

Answer by Rob Farley

My preference for explaining this question comes down to the paradigm that database systems employ. When you really get into it, a database system runs on a computer, and eventually works things out...

View Article

Comment by Matt Whitfield

I'll leave it 6 days before expanding my answer :)

View Article

Answer by Tom Staab

A procedural approach follows the paradigm of traditional languages used for applications. You perform a function then call another function and so on. When this method is used to retrieve data from a...

View Article


Comment by Peso on Tim Ford's answer

It depends. Updating a 40 million record table in 40 chunks may be faster than updating the table in one chunk. You have to be careful about your log file.

View Article

Comment by Matt Whitfield on Tim Ford's answer

Very good point Peso - I have witnessed this before - while importing 184 million legacy transactions into a client's system I gave up on the 'single insert' operation after it had been running for 24...

View Article

Comment by Rob Farley on Tim Ford's answer

Tim - nice analogy, but as Peso points out, you should be careful about your LOGS (k'boom tsh!). Your comment about "a single log each trip" may actually be more profound than you realise.

View Article


Answer by sbhollis

I landed here while trying to find something that described when it is not appropriate to use a set based language to solve a problem. Or in other words what types of algorithms don't lend themselves...

View Article


Comment by Matt Whitfield on sbhollis's answer

I'm not really sure what you mean by: > On a similar note I wonder if the CS discussion on this would involve recurrence relations in relationship to the time complexity of set based algorithms. But...

View Article

Comment by Magnus Ahlkvist on Tom Staab's answer

A late comment: Nice example. But I have to disagree on one point: **Each time we execute the statement "FETCH NEXT", we are essentially re-executing that SELECT statement to get the next top result...

View Article

Comment by Scot Hauder on sbhollis's answer

"I don't know that I can elegantly and simply articulate the principles involved. If someone can that would be great" Bubble sort: SELECT [your coulmn] ORDER BY [your column] "Another thing that should...

View Article

Answer by Magnus Ahlkvist

One little addition from me: We have many, many stored procedures which use cursors. Sure - some of them could probably be replaced by a set based approach. Some of them definitely by...

View Article


Comment by sbhollis on sbhollis's answer

My comments about Computer Science were a poor attempt at me trying to dust off my unused knowledge from school. I just figure there must be a "formal" description of what we are discussing - when is a...

View Article

Answer by GPO

Although the discussion here has focussed on cursors to a large extent, my pet hate is scalar functions in SELECT statements, where the scalar functions contain (and very effectively hide) SELECT...

View Article


Answer by danlatimer

This isn't a complicated question and does not require a complicated answer: **Short Answer:** Databases are most efficient when you tell them what you want and let them figure out the most efficient...

View Article

Answer by Tom Staab

A procedural approach follows the paradigm of traditional languages used for applications. You perform a function then call another function and so on. When this method is used to retrieve data from a...

View Article


Answer by sbhollis

I landed here while trying to find something that described when it is not appropriate to use a set based language to solve a problem. Or in other words what types of algorithms don't lend themselves...

View Article

Answer by Tom Staab

A procedural approach follows the paradigm of traditional languages used for applications. You perform a function then call another function and so on. When this method is used to retrieve data from a...

View Article

Answer by sbhollis

I landed here while trying to find something that described when it is not appropriate to use a set based language to solve a problem. Or in other words what types of algorithms don't lend themselves...

View Article
Browsing all 42 articles
Browse latest View live




Latest Images