Re: [sqlite] MySQL / SQLite

2004-04-14 Thread Jimmy Lantz
At 19:32 2004-04-14, you wrote:
Yes, but are mysql_query and sqlite_query really doing the same thing? It 
is quite possible that mysql_query doesn't actually perform the complete 
query, while sqlite_query does. I think a better test would be to do the 
query and then step through all of the results, doing something with each 
row. What is the time difference for that?
Ok:

$array = array();
include("../cardsearch/setMySQL.php");
$erg = mysql_query("SELECT * FROM speedtest WHERE text5 LIKE '%a%'");
while($row=mysql_fetch_row($erg)) $array[] = $row;
$array = array();
$db = sqlite_open("speedtest.sqlite");
$result = sqlite_query($db, "SELECT * FROM speedtest WHERE text5 LIKE '%a%'");
while($row=sqlite_fetch_array($result)) $array[] = $row;
MySQL: 0.24748015403748
SQLite: 0.68342804908752
$array = array();
$db = sqlite_open("speedtest.sqlite");
$result = sqlite_unbuffered_query($db, "SELECT * FROM speedtest WHERE 
text5 LIKE '%a%'");
while($row=sqlite_fetch_array($result)) $array[] = $row;

MySQL: 0.23681807518005
SQLite: 0.64980888366699
I ran it several times, of course.
I think there might be some work needed on the PHP implementation of SQLite 
(marked as experimental)
Whereas the MySQL implementation has had years to mature and improve.
Do your tests using the CLI instead and see if you get the same.
/ Jimmy

-hannes



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[sqlite] CREATE TABLE on conflict ignore?

2004-03-25 Thread Jimmy Lantz
Hi SQLiters!

Can someone tell me the proper syntax for CREATE TABLE  and if theres a 
conflict ignore it.
I've tried several versions of the CREATE TABLE query.

All I get is an error that the table already exists.
Thats what I'm trying to avoid.
I've tried using BEGIN ON CONFLICT IGNORE and COMMIT in order to get rid of 
it. But no luck.

Would be grateful for any hints.
Cheers
Jimmy.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]