Bluehost.com Web Hosting $6.95

SQLITE

This is a discussion on SQLITE within the PHP General forums, part of the PHP Programming Forums category; Hi, I've got questions: I've got sqlite like PHP module (under windows). I tried this: a)execute script ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-22-2003
Bronislav klučka
 
Posts: n/a
Default SQLITE

Hi, I've got questions:

I've got sqlite like PHP module (under windows). I tried this:
a)execute script 1 (selecting from some table), it tooks 2 minutes
b)execute script 2 , it tooks 3 minutes
c)execute them both at the same time (from different browser windows), both
of them stopped also at the same time and it tooks 5 minutes

I've tried another questions and both of the scripts allways stopped at the
same time with duration of he sum of the time fo each process separated.
This is not, of course, the behaviour I would expect... Is this some feature
of sqlite or an I doing something wrong??

I've also tried the same with MySql and the result should be like
1/ first script alone - 2 minutes
2/ second script alone - 3 minutes
3/ both of them at the same time - first took 3 minutes, second took 4
minutes...



Brona
Reply With Quote
  #2 (permalink)  
Old 11-22-2003
Chris Shiflett
 
Posts: n/a
Default Re: [PHP] SQLITE

--- Bronislav_Klučka <Bronislav.Klucka@pro2-soft.com> wrote:
> Hi, I've got questions:


I only noticed one.

> I've got sqlite like PHP module (under windows). I tried this:
> a)execute script 1 (selecting from some table), it tooks 2 minutes
> b)execute script 2 , it tooks 3 minutes
> c)execute them both at the same time (from different browser
> windows), both of them stopped also at the same time and it tooks
> 5 minutes


[snip]

> Is this some feature of sqlite or an I doing something wrong?


Without seeing any code or being given any details, all I can make is an
educated guess. SQLite uses the filesystem for storage. If your queries
are needing to access the same file (maybe you're querying the same
table), SQLite is going to serialize those queries to help you avoid
threading problems. So, your queries are going to basically take turns.

Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
RAMP Training Courses
http://www.nyphp.org/ramp
Reply With Quote
  #3 (permalink)  
Old 11-23-2003
Bronislav Klucka
 
Posts: n/a
Default RE: [PHP-DB] Re: [PHP] SQLITE

That's my code:
$dbfile="db.sdb";
$db=sqlite_open($dbfile);
$res=sqlite_query($db,"select a.*,b.* from a left join b on a.id=b.id_a
where a.name like \"%1%\" or b.street like \"%1%\" order by cellphone");
echo sqlite_num_rows($res).CRLF;
sqlite_close($db);

It's realy just "benchmark" I've done. I'm pretty much aware of system
sqlite is useing to store the data, and I also find obvious that if it would
be runnig like web database module, users will ask the same table ata the
same time (like with other db system, they are looking at the same page) but
I find it not good, I was only asking if there is a "way to change it"


Bronislav Klucka

>
> > Is this some feature of sqlite or an I doing something wrong?

>
> Without seeing any code or being given any details, all I can make is an
> educated guess. SQLite uses the filesystem for storage. If your queries
> are needing to access the same file (maybe you're querying the same
> table), SQLite is going to serialize those queries to help you avoid
> threading problems. So, your queries are going to basically take turns.
>

Reply With Quote
  #4 (permalink)  
Old 11-23-2003
Curt Zirzow
 
Posts: n/a
Default Re: [PHP] SQLITE

* Thus wrote Bronislav Klučka (Bronislav.Klucka@pro2-soft.com):
> Hi, I've got questions:
>
> I've got sqlite like PHP module (under windows). I tried this:
> a)execute script 1 (selecting from some table), it tooks 2 minutes
> b)execute script 2 , it tooks 3 minutes
> c)execute them both at the same time (from different browser windows), both
> of them stopped also at the same time and it tooks 5 minutes


Read the sqlite faq:
http://sqlite.org/faq.html#q7

Curt
--
"My PHP key is worn out"

PHP List stats since 1997:
http://zirzow.dyndns.org/html/mlists/
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:32 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0