Visualizzazione dei risultati da 1 a 3 su 3

Discussione: Vista per filtare dati

  1. #1

    Vista per filtare dati

    Ciao,
    ad un certo punto di uno script devo fare una query
    molto pesante.
    Avrei pensato di fare un passaggio intermedio
    creare una vista del tipo

    Codice PHP:
    CREATE VIEW myuser AS SELECT 
    id
    ,email,first_name,last_name FROM user WHERE status='confirmed'
    quindi farei la query direttamente su myuser
    eliminando gia un buon numero di records.
    Naturalmente + filtro + il numero di records diminuisce.

    Che ne pensate ?

    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

  2. #2
    mi rispondo da solo

    [A view is simply a "virtual" or "logical" table. The rows in a view are not actually stored anywhere and so every time you access the view in a query, the select specified in the view is run every time.]

    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

  3. #3
    alla fine ho deciso per una store procedure.
    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.