Posted By: Cairo | Aug 25th, 2005 @ 10:13 AM
page 3 of 3
Comments: 57 | Views: 46400
Tensor
Tensor
Im in yr house upgrading yr family
Cairo wrote:

It's certainly a home-made version of it.  It's good that SQL Server 2005 will support row_number().

If wonder which is more efficient - LIMIT or the ROW_NUMBER() hack.



As SQL 2005 doesnt support LIMIT, how are we to know? If MySQL supports row_number you could see how they perform in MySQL but that wont tell you much.

Of course you'd have to do it in raw SQL rather than a precompild procedure. I wonder what is more efficient then?
Hi
I've been reading this thread an have found it interesting. As far as I can see you are all trying to manage paging in ms jet via php. Using sql seems not to do it, so one will have to find another way around the problem.

I have been using ms jet for access 2000 toghether with php for about half a year and I too have felt the lack of the limit clause in this version of sql.

My method is not escpecially sophisticated. I use two queries, one to count the number of records that will be of interest, and another to select the fields of interest in these records.

Then I pick out the fields from the select query and put them into named arrays, using a flow sentence (for..., while can be used as well), whereby field1[0] and field2[0] are from the same row in the query (these names can be changed to other, more descriptive ones, of cource, like first_name[0] and last_name[0]..) . This will result in a series of arrays containing the selected data for the rows in the query, where the index of the array holds fields from corresponding rows.

Now, let's say I want to have a page size of 10 records. The first page then will contain records 0..9, the second records 10..19 and so on. My first query will have provided me with the number of records. I can now compute the number of pages with a

$total_pages=round($number_of_records/$page_size);

and I will also be able to compute the desired array indexes for a given page, by finding the first array index for this page, using:

$page_nr (page number)

$first_index_on_page=$page_nr*$page_size;
$last_index_on_page=$first_index_on_page+$page_size-1;

and loop through these indexes using a for sentence:

for ($index=$first_index_on_page;$last_index_on_page;$index++)

and then display the data and page number using a table row syntax in html.

Using << and >> and page numbers, I can then make the script pick up the correct data in the same script.

This is my workarround for the lacking limit clause in ms jet, but it's not my recipee, I picked it up somewhere on the net earlier this year.

Hope thsi can help someone. If this is not clear enough, let me know.Cool
Tensor wrote:

As for MySQL.... well, sorry, but it is not an Enterprise database. It just isnt. Take a look at the TPC. Do you see MySQL in any of those performance tables?
 
No.

Why?

Because they dont even test it. 
While I don't claim to be even remotely qualified to determine what qualifies a RDBMS as "enterprise class" I would note two things and ask one question: 1) It looks like your TPC organization doesn't rank MySQL simply because MySQL hasn't joined their little club. So I don't think saying "TPC doesn't even bother to rank them" is a valid criticism. 2) Many, many Oracle bigots don't consider SQL Server enterprise class. Thus, SQL server bigots saying MySQL can't be enterprise class are correct? 3) What's the definition of "enterprise class?" I'm curious to know.
Lloyd_Humph
Lloyd_Humph
If Blackberrys are addictive cellphones, Channel9 is the ultimate addictive website.
Thanks for digging this up.
odujosh
odujosh
Need Microsoft SUX now!
It is suprising how much you can do with SQL Server Express most websites will have a hard time hitting the 4 GB limit. I like Sql Management Studio. The big think MySQL lacks is well polish.

I don't buy the cost of a liscense argument. Your bigger expenses are  things  like hardware, salaries of DBA(s), consulting, COTs packages the list goes on. Sticker shock for liscensing is missing the forest for a tree, the attitude of someone who hasn't seen enterprises at work and how much money goes into IT budgets.
Matthew van Eerde
Matthew van Eerde
AKA Maurits
I remember this thread... good times, good times Smiley
page 3 of 3
Comments: 57 | Views: 46400
Microsoft Communities