Rewrite of where.c without DOUBLE Values

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Rewrite of where.c without DOUBLE Values

Sankara Narayanan
Dear Hipp and all,

We request you to provide guidelines for the implementation of where.c
without using any of the DOUBLE values. We need to find the bestIndex
calculation with all integer variables and integer values. We converted
all doubles to integers by typecasting (we use #define as double
overriding the DOUBLE definition in our C Libraries) and thus we could
compile the library for our ARM 7 platform.

We first open a database using sqlite3_open and this function succeeds.
When we try to run the CREATE TABLE Command, we find that
sqlite3WhereBegin is called, and we find that the command execution
returns with error 0x1A (File Not a database error).

We have modified only the values in where.c with the integer values as
mentioned in my earlier mail but we think that this could cause problems
as we might be messing up the bestIndex finding algorithm with these
changes. I request you to please review the code that is sent earlier and
provide comments/guidelines on how we could implement the bestIndex
algorithm using integer values (to the closest possible working
algorithm).

Please note that in our schematics, we are also creating indices for
tables that have VARCHAR fields.

I request you to kindly look into this problem at the earliest.

Thank you,
 
With Regards,
Sankara Narayanan
Philips Innovation Campus
No 1, Murphy Road,
Ulsoor, Bangalore - 560008.
Ph - 0091-80-25579000 Extn 5121

"Utthistatha Jaagrata Praapya Varaan Nibodhatha"
Reply | Threaded
Open this post in threaded view
|

Re: Rewrite of where.c without DOUBLE Values

Dennis Cote
Sankara Narayanan wrote:

>Dear Hipp and all,
>
>We request you to provide guidelines for the implementation of where.c
>without using any of the DOUBLE values. We need to find the bestIndex
>calculation with all integer variables and integer values. We converted
>all doubles to integers by typecasting (we use #define as double
>overriding the DOUBLE definition in our C Libraries) and thus we could
>compile the library for our ARM 7 platform.
>
>We first open a database using sqlite3_open and this function succeeds.
>When we try to run the CREATE TABLE Command, we find that
>sqlite3WhereBegin is called, and we find that the command execution
>returns with error 0x1A (File Not a database error).
>
>We have modified only the values in where.c with the integer values as
>mentioned in my earlier mail but we think that this could cause problems
>as we might be messing up the bestIndex finding algorithm with these
>changes. I request you to please review the code that is sent earlier and
>provide comments/guidelines on how we could implement the bestIndex
>algorithm using integer values (to the closest possible working
>algorithm).
>
>Please note that in our schematics, we are also creating indices for
>tables that have VARCHAR fields.
>
>I request you to kindly look into this problem at the earliest.
>
>Thank you,
>
>With Regards,
>Sankara Narayanan
>Philips Innovation Campus
>No 1, Murphy Road,
>Ulsoor, Bangalore - 560008.
>Ph - 0091-80-25579000 Extn 5121
>
>"Utthistatha Jaagrata Praapya Varaan Nibodhatha"
>  
>
Your requests sound rather urgent. Perhaps you should look at getting a
professional support contract to deal with this issue. More information
is available at http://www.hwaci.com/sw/sqlite/prosupport.html. This is
the most likely way to get Richard Hipp to look at your issue immediately.

Dennis Cote
Reply | Threaded
Open this post in threaded view
|

Re: Rewrite of where.c without DOUBLE Values

John LeSueur
In reply to this post by Sankara Narayanan
Sankara Narayanan wrote:

>Dear Hipp and all,
>
>We request you to provide guidelines for the implementation of where.c
>without using any of the DOUBLE values. We need to find the bestIndex
>calculation with all integer variables and integer values. We converted
>all doubles to integers by typecasting (we use #define as double
>overriding the DOUBLE definition in our C Libraries) and thus we could
>compile the library for our ARM 7 platform.
>
>We first open a database using sqlite3_open and this function succeeds.
>When we try to run the CREATE TABLE Command, we find that
>sqlite3WhereBegin is called, and we find that the command execution
>returns with error 0x1A (File Not a database error).
>
>We have modified only the values in where.c with the integer values as
>mentioned in my earlier mail but we think that this could cause problems
>as we might be messing up the bestIndex finding algorithm with these
>changes. I request you to please review the code that is sent earlier and
>provide comments/guidelines on how we could implement the bestIndex
>algorithm using integer values (to the closest possible working
>algorithm).
>
>Please note that in our schematics, we are also creating indices for
>tables that have VARCHAR fields.
>
>I request you to kindly look into this problem at the earliest.
>
>Thank you,
>
>With Regards,
>Sankara Narayanan
>Philips Innovation Campus
>No 1, Murphy Road,
>Ulsoor, Bangalore - 560008.
>Ph - 0091-80-25579000 Extn 5121
>
>"Utthistatha Jaagrata Praapya Varaan Nibodhatha"
>  
>
Well, if you don't care about using indexes other than the primary key,
it looks like you could do this:

static double bestIndex(
  Parse *pParse,              /* The parsing context */
  WhereClause *pWC,           /* The WHERE clause */
  struct SrcList_item *pSrc,  /* The FROM clause term to search */
  Bitmask notReady,           /* Mask of cursors that are not available */
  ExprList *pOrderBy,         /* The order by clause */
  Index **ppIndex,            /* Make *ppIndex point to the best index */
  int *pFlags,                /* Put flags describing this choice in *pFlags */
  int *pnEq                   /* Put the number of == or IN constraints here */
){
    ppIndex = pSrc->pTab->pIndex;
}

I'm pretty sure this is a bad idea, but you could do it for now, just to get started on testing and things.

John LeSueur