[Kexi] LIMIT 1 in Select Clause

Sharan Rao sharanrao at gmail.com
Sat Dec 15 18:30:23 CET 2007


On Thursday 13 Dec 2007 4:37:20 am Jarosław Staniek wrote:
> There can be multiple rows. I don't know whether Sybase raises the
> warning/error based on the semantics of the statement or after it know
> there are many rows.

   It invariably raises a warning.
 
> The case when we have many rows (and when addLimitTo1==true) whould be when
> we indeed know that all the values of the column #column are the same, so
> we agree on the optimization.
>
> Using ORDER BY is indeed good idea. We can use it by adding:
>
>   QString::fromLatin1(" ORDER BY %1").arg(column) to the statement.
>
> But now, what about statements already having ORDER BY part?
>
> There are two simple options for such statements:
> 1. set addLimitTo1 to false (so drop optimization)
> 2. add another boolean 'ordered' flag so in case of Sybase driver we can
> force addLimitTo1 to false.
>
> For 2. we're getting more and more flags, but I already think about having
> a data structure or a QFlag combining multiple options...

2 Seems like a good idea, Hmm, ok so are we adding a new flag ?

Cheers!
 Sharan Rao



More information about the Kexi mailing list