[Qt-interest] qsqlquery anyone with any experience at all?
Roland Tollenaar
rwatollenaar at gmail.com
Wed Sep 1 09:33:58 CEST 2010
Hi Scott,
> The .value( 0 ) is what of course converts the data to the qvariant...
Indeed, but good point.
>
> What kind of server are you connected too..
mssql 2005
>That just seems awfully
> slow, and I haven't seen that before...
That gives me some hope....
>
> Is it possible that the server, or your query, is returning raw strings,
> and you are converting them to other types??
I almost without exception convert to String using:
toString()
so ThisString=query.value(0).toString();
>
> Your datetimes can be very slow because of the string to date parsing
> that goes on...
there are not many datetimes. one or two.
What is interesting is that the data is retrieved from the database
server in the while(query.next()) loop. I was always under the
impression that all the data was retrieved on the exec call and then
parsed locally in the while loop. However that is definitely not the case.
Regards,
Roland
>
>
> -----Original Message-----
> From: Roland Tollenaar [mailto:rwatollenaar at gmail.com]
> Sent: Wednesday, September 01, 2010 12:15 AM
> To: Scott Aron Bloom
> Cc: Qt-interest
> Subject: Re: [Qt-interest] qsqlquery anyone with any experience at all?
>
> Hi Scott,
>
> exec and the (empty) while(query.next()) loop takes< 2 seconds to
> execute.
>
> adding only this line:
>
> query.value(0);
>
> in the while(query.next()) loop takes the time up to 40 seconds.
>
> This is on my local database, to the serverr over the network takes a
> bit longer.
>
> There are about 15000 records.
>
> Datatype is varchar, text and datetime. No BLOBS.
>
> any ideas?
>
> Kind regards,
>
> Roland
>
>
>
> On 01-09-2010 8:52 AM, Scott Aron Bloom wrote:
>> Message received...
>>
>> Some pointers, the Qt overhead, is really quite minimal..
>>
>> First, does your SQL backend, have a "preferred client" how quickly
> does
>> it send back large record sets...
>>
>> What data is being sent back?? Large BLOBs get read into QByteArrays,
>> meaning they take up ram... is it possible your just dealing with a
> ton
>> of data..
>>
>> For me, I tend to find the majority of the delay in the exec, not in
> the
>> query.next()...
>>
>> Scott
>>
>> -----Original Message-----
>> From: qt-interest-bounces at trolltech.com
>> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Roland
> Tollenaar
>> Sent: Tuesday, August 31, 2010 11:27 PM
>> To: Qt-interest
>> Subject: [Qt-interest] qsqlquery anyone with any experience at all?
>>
>> Hi,
>>
>> I posted below but am not sure whether my posts are arriving on the
>> list.
>>
>> Is there anyone who has _any_ experience with qsqlquery at all?
>>
>> Regards,
>>
>> Roland
>>
>> Hi,
>>
>> we have found that using query.next() in combination with qodbc is
> very
>> very slow in qt 4.5.2.
>>
>> Is there a faster manner to process large recordsets or has the
>> qsqlquery (or qodbc) class been improved dramatically in 4.6 that
> anyone
>>
>> knows of?
>>
>> thanks in advance for any advice,
>>
>> Roland
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list