Hmmm...appears to be the same for this case which, I must say, I find 
surprising.

This is on sqlite 3.3.6 on RedHat.

And both runs are CPU bound.





cc -DTEXT -o gendat gendat.c

./gendat >index1.sql

cc -o gendat gendat.c

./gendat >index2.sql



main()
{
        char sql[4096];
        char key[9];
        long *lkey=key;
        int i;
#ifdef TEXT
        puts("CREATE TABLE t (a text);");
#else
        puts("CREATE TABLE t (a integer);");
#endif
        puts("CREATE INDEX tx on t(a);");
        puts("BEGIN;");
        for(i=0;i<1000000;++i) {
                int j;
                for(j=0;j<8;++j) {
                        key[j]=(random()%26)+'a';
                }
#ifdef TEXT
                printf("insert into t values('%s');\n",key);
#else
                printf("insert into t values(%ld);\n",*lkey);
#endif
        }
        puts("COMMIT;");
}



 time sqlite3 <index1.sql
19.307u 0.082s 0:19.40 99.8%    0+0k 0+0io 0pf+0w

time sqlite3 < index2.sql
19.266u 0.092s 0:19.37 99.8%    0+0k 0+0io 0pf+0w



Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to