By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,830 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

MMAP extension for PHP5

P: n/a
Is there such a thing? I need a good pager for Oracle RDBMS which will
not re-execute the same query gazillion times. In order to do that, I
plan on writing query results to a file and then map the file to an
array. In order for the whole thing to work reasonably fast, I need
something similar to mmap - therefore the question. I need to map large
chunk of disk space to memory and do it fast. Any ideas?
--
Mladen Gogala
http://www.mgogala.com
Jul 18 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Mladen Gogala wrote:
Is there such a thing? I need a good pager for Oracle RDBMS which will
not re-execute the same query gazillion times. In order to do that, I
plan on writing query results to a file and then map the file to an
array. In order for the whole thing to work reasonably fast, I need
something similar to mmap - therefore the question. I need to map large
chunk of disk space to memory and do it fast. Any ideas?
Is the Oracle off limits? I mean, having/creating tables for the
temporary query result, which you subsequently select from. You'll
need to clean up at some point afterwards, but I reckon you need some
mechanism for that anyway.

--
/Bent
Jul 18 '06 #2

P: n/a
On Wed, 19 Jul 2006 01:30:03 +0200, Bent Stigsen wrote:
Is the Oracle off limits? I mean, having/creating tables for the
temporary query result,
No, Oracle isn't off limits.
which you subsequently select from. You'll
need to clean up at some point afterwards, but I reckon you need some
mechanism for that anyway.
Problem with paging in Oracle is this: if you want to page the output of
a query, you have to execute it over and over again and discard all except
the few rows. That's wasteful and slow. Trick to do that would be to
open a temporary file and map it to memory as an array. My question is: is
there a way to do mmap in PHP5? Thanks to anyone who might help me with an
answer.

--
http://www.mgogala.com

Jul 19 '06 #3

P: n/a
Mladen Gogala wrote:
On Wed, 19 Jul 2006 01:30:03 +0200, Bent Stigsen wrote:
>Is the Oracle off limits? I mean, having/creating tables for the
temporary query result,

No, Oracle isn't off limits.
>which you subsequently select from. You'll
need to clean up at some point afterwards, but I reckon you need some
mechanism for that anyway.

Problem with paging in Oracle is this: if you want to page the output of
a query, you have to execute it over and over again and discard all except
the few rows. That's wasteful and slow.
Doesn't need to be like that. You could:

insert into cache_table select 'unique id' "_qid", rownum "_row",
....huge slow query...;

then then select on "_qid" and "_row" afterwards.

If they are indexed, Oracle should give what you need quite fast, and
shouldn't subsequently require much disc-io even if the result set is
humongous. It should be fast enough, I would think.
Trick to do that would be to
open a temporary file and map it to memory as an array. My question is: is
there a way to do mmap in PHP5? Thanks to anyone who might help me with an
answer.
Sorry can't help you there.

Not the same, but from the description of the apc extension, sounds
like you could use its apc-store and fetch.

--
/Bent
Jul 19 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.