Cita:
Empezado por newtron
Ya, pero eso con tablas a partir de unos miles de registros no es operativo porque tardaría muchisimo en abrir la tabla, con la base de datos que yo uso la apertura de componentes ttable es inmediato independientemente del número de registros y quiero recordar que pasado esa historia estuve haciendo pruebas con algún componente de pago para firebird y también abrían los ttable de forma inmediata, pero ya era tarde.
|
uummm... creo que no
Abrir la tabla debe ser inmediato con todos, lo que ocurre es que algunos componentes tienen una propiedad para indicar si quieres que cargue todo en memoria o no.
Evidentemente, si tiene que cargarlos todos, por ejemplo, haciendo un 'fetch' (ir al final .last) o contar los registros, será lento cuando tengas muchos registros.
Pero todos trabajan igual, me explico, un componente Table es lo que he comentado antes, un Dataset que su sql pone "select * from tabla". No hay más, ni puede haberlo.
En
este hilo se habló sobre ese tema y aquí están los resultados:
Zeos:
Código Delphi
[-]procedure TZAbstractTable.SetTableName(const Value: string);
begin
if FTableName <> Value then
begin
FTableName := Value;
if Value <> '' then
SQL.Text := Format('SELECT * FROM %s', [FTableName])
else SQL.Text := '';
end;
end;
IBX:
Código Delphi
[-]SQL := TStringList.Create;
SQL.Text := 'select ' +
QuoteIdentifier(DataBase.SQLDialect, FTableName) + '.*, '
+ 'RDB$DB_KEY as IBX_INTERNAL_DBKEY from '
+ QuoteIdentifier(DataBase.SQLDialect, FTableName);
if Filtered and (Filter <> '') then
begin
SQL.Text := SQL.Text + ' where ' + Filter;
bWhereClausePresent := True;
MDO:
Código Delphi
[-]SQL := TStringList.Create;
SQL.Text := 'select ' +
QuoteIdentifier(DataBase.SQLDialect, FTableName) + '.*, '
+ 'RDB$DB_KEY as IBX_INTERNAL_DBKEY from '
+ QuoteIdentifier(DataBase.SQLDialect, FTableName);
if Filtered and (Filter <> '') then
begin
SQL.Text := SQL.Text + ' where ' + Filter;
bWhereClausePresent := True;
IBDAC
Código Delphi
[-]select count(*) from table;
select * from table;